Граф коммитов

11329 Коммитов

Автор SHA1 Сообщение Дата
J. Bruce Fields 407c0c87e1 user-manual: mention git-gui
The git gui project seems to be still in early stages, but at a point
where it's worth mentioning as an alternative way of creating commits.

One feature of interest is the ability to manipulate individual diff
hunks.  However, people have found that feature not to be easily
discoverable from the user-interface.  Pending some ui improvements, a
parenthetical hint here may help.

(Thanks to Steffen Prohask and Junio Hamano for suggesting the
language.)

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2007-08-05 18:13:56 -04:00
Junio C Hamano 7a7cc594ca user-manual: mention git stash
Mention the git-stash command as a way to temporarily set aside work in
progress.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2007-08-05 17:45:47 -04:00
J. Bruce Fields 0eb4f7cdf8 user-manual: update for new default --track behavior
Update documentation to reflect the --track default.

That change seems to have happened in the 1.5.3 -rc's, so bump the "for
version x.y.z or newer" warning as well.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2007-08-05 17:29:01 -04:00
Junio C Hamano 00d8c5180d Fix install-doc-quick target
The script starts in a subdirectory of the source directory to
muck with a branch whose structure does not have anything to
do with the actual work tree.  Go up to the top to make it clear
that we operate on the whole tree.

It also exported GIT_DIR without any good reason.  Remove it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-05 10:56:50 -07:00
Junio C Hamano 936492d3cf unpack-trees.c: assume submodules are clean during check-out
Sven originally raised this issue:

    If you have a submodule checked out and you go back (or
    forward) to a revision of the supermodule that contains a
    different revision of the submodule and then switch to
    another revision, it will complain that the submodule is not
    uptodate, because git simply didn't update the submodule in
    the first move.

The current policy is to consider it is perfectly normal that
checked-out submodule is out-of-sync wrt the supermodule index.
At least until we introduce a superproject repository
configuration option that says "in this repository, I do care
about this submodule and at any time I move around in the
superproject, recursively check out the submodule to match", it
is a reasonable policy, as we currently do not recursively
checkout the submodules at all.  The most extreme case of this
policy is that the superproject index knows about the submodule
but the subdirectory does not even have to be checked out.

The function verify_uptodate(), called during the two-way merge
aka branch switching, is about "make sure the filesystem entity
that corresponds to this cache entry is up to date, lest we lose
the local modifications".  As we explicitly allow submodule
checkout to drift from the supermodule index entry, the check
should say "Ok, for submodules, not matching is the norm" for
now.

Later when we have the ability to mark "I care about this
submodule to be always in sync with the superproject" (thereby
implementing automatic recursive checkout and perhaps diff,
among other things), we should check if the submodule in
question is marked as such and perform the current test.

Acked-by: Lars Hjemli <hjemli@gmail.com>
Acked-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-05 10:55:55 -07:00
Jyotirmoy Bhattacharya 64a476e691 Fixed git-push manpage
In git-push it is the remote repository and not the
local repository which is fast forwarded. The description
of the -f option in the git-push manpage gets it the other
way round.

Signed-off-by: Jyotirmoy Bhattacharya <jyotirmoy@jyotirmoy.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04 22:35:13 -07:00
Johannes Schindelin 4465f410d6 checkout-index needs a working tree
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04 21:22:14 -07:00
Randal L. Schwartz 936800bb55 add "test-absolute-path" to .gitignore
New file requires new ignore.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04 01:57:29 -07:00
Shawn O. Pearce d5538b418d Document GIT_SSH environment variable alongside other variables
The GIT_SSH environment variable has survived for quite a while
without being documented, but has been mentioned on list and on
my day-job repositories can only be accessed via magic supplied
through the wonderous hack that is GIT_SSH.

Advertising it alongside other "low level magic" such as GIT_PAGER
and GIT_MERGE_VERBOSITY will certainly help others who need to
spread their own pixie dust to make things work.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04 01:55:08 -07:00
Junio C Hamano 2ec39edad9 INSTALL: add warning on docbook-xsl 1.72 and 1.73
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04 01:55:08 -07:00
Jakub Narebski 33f2433085 gitweb: Fix handling of $file_name in feed generation
The commit b6093a5c, by Robert Fitzsimons:
  "gitweb: Change atom, rss actions to use parse_commits."
forgot to pass $file_name parameter to parse_commits subroutine.

If git_feed is provided a file name, it ought to show only the history
affecting that file or a directory.  The title was being set
correctly, but all commits from history were being shown.

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04 01:55:08 -07:00
Junio C Hamano 7fd53fce1c git-completion: add "git stash"
This is a new addition to 1.5.3; let's teach it to the
completion before the final release.

[sp: Added missing git-stash completion configuration]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-04 03:14:28 -04:00
Väinö Järvelä 51b8c5021a git-gui: Added support for OS X right click
OS X sends Button-2 on a "real" right click, such as with a three
button mouse, or by using the two-finger trackpad click.

Signed-off-by: Väinö Järvelä <v@pp.inet.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-04 02:47:30 -04:00
Junio C Hamano 4f8f03d643 GIT 1.5.3-rc4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-03 15:33:57 -07:00
Junio C Hamano a697ec69cb Fix bogus use of printf in t3700 test
The hashed contents did not matter in the end result, but it passed
an uninitialized variable to printf, which caused it to emit empty
while giving an error/usage message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-03 14:31:47 -07:00
Junio C Hamano d20602eec9 gitweb: do not choke on recursive symlink
If somebody used to advertise his repository that physically
resides at /pub/lic.git/ as:

	git://git.example.com/pub/lic.git/

but now wants to use --base-path to allow:

	git://git.example.com/lic.git/

she can start git-daemon with --base-path option, like this:

	git-daemon --base-path=/pub --export-all

During the transition, however, she would also want to allow
older URL as well.  One natural way to achieve that is to create
a symlink:

	ln -s /pub /pub/pub

so that a request to git://git.example.com/pub/lic.git/ is first
translated by --base-path to a request to /pub/pub/lic.git/
which goes to /pub/lic.git, thanks to the symlink.

So far so good.

However, gitweb chokes if there is such a symlink (File::Find
barfs with "/pub/pub is a recursive symbolic link").  Make the
code ignore such a symlink.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-03 01:35:36 -07:00
Shawn O. Pearce a13ee29b97 git-gui: Avoid Tcl error in popup menu on diff viewer
If there is no path currently shown in the diff viewer then we
were getting Tcl errors anytime the user right-clicked on the
diff viewer to bring up its popup menu.  The bug here is caused
by trying to get the file_state for the empty string; this path
is never seen so we never have file_state for it.  In such cases
we now disable the Stage Hunk For Commit option.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-02 22:55:22 -04:00
Junio C Hamano 6490a3383f Fix work-tree related breakages
In set_work_tree(), variable rel needs to be reinitialized to
NULL on every call (it should not be static).

Make sure the incoming dir variable is not too long before
copying to the temporary buffer, and make sure chdir to the
resulting directory succeeds.

This was spotted and fixed by Alex and Johannes in a handful
patch exchanges.  Here is the final version.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
2007-08-02 17:26:26 -07:00
David Symonds 29093c28a2 Fix documentation for core.gitproxy to reflect code
The current implementation of core.gitproxy only operates on
git:// URLs, so the ssh:// examples and custom protocol examples
have been removed or edited.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-02 17:26:07 -07:00
Johannes Schindelin d825a97495 read-tree: remove unnecessary call to setup_git_directory()
read-tree is already marked with RUN_SETUP in git.c, so there is
no need to call setup_git_directory() a second time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-02 17:26:07 -07:00
Thomas Schwinge c29ba0c3ed Support building on GNU/Hurd
GNU/Hurd systems don't have strlcpy.

Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-02 17:26:02 -07:00
Han-Wen Nienhuys 7fcff9def5 Fix style nit in Python slicing.
Python slices start at 0 by default.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-08-02 09:40:28 +02:00
Han-Wen Nienhuys a4eba020f9 Sort output of "p4 change" in incremental import before further
processing

P4 change outputs the changes sorted for each directory separately. We
want the global ordering on the changes, hence we sort.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-08-02 09:40:25 +02:00
Junio C Hamano 68d4229847 RelNotes 1.5.3 updates before -rc4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-02 00:13:03 -07:00
Junio C Hamano 3d5c418ff5 git-clone: aggressively optimize local clone behaviour.
This changes the behaviour of cloning from a repository on the
local machine, by defaulting to "-l" (use hardlinks to share
files under .git/objects) and making "-l" a no-op.  A new
option, --no-hardlinks, is also added to cause file-level copy
of files under .git/objects while still avoiding the normal
"pack to pipe, then receive and index pack" network transfer
overhead.  The old behaviour of local cloning without -l nor -s
is availble by specifying the source repository with the newly
introduced file:///path/to/repo.git/ syntax (i.e. "same as
network" cloning).

 * With --no-hardlinks (i.e. have all .git/objects/ copied via
   cpio) would not catch the source repository corruption, and
   also risks corrupted recipient repository if an
   alpha-particle hits memory cell while indexing and resolving
   deltas.  As long as the recipient is created uncorrupted, you
   have a good back-up.

 * same-as-network is expensive, but it would catch the breakage
   of the source repository.  It still risks corrupted recipient
   repository due to hardware failure.  As long as the recipient
   is created uncorrupted, you have a good back-up.

 * The new default on the same filesystem, as long as the source
   repository is healthy, it is very likely that the recipient
   would be, too.  Also it is very cheap.  You do not get any
   back-up benefit, though.

None of the method is resilient against the source repository
corruption, so let's discount that from the comparison.  Then
the difference with and without --no-hardlinks matters primarily
if you value the back-up benefit or not.  If you want to use the
cloned repository as a back-up, then it is cheaper to do a clone
with --no-hardlinks and two git-fsck (source before clone,
recipient after clone) than same-as-network clone, especially as
you are likely to do a git-fsck on the recipient if you are so
paranoid anyway.

Which leads me to believe that being able to use file:/// is
probably a good idea, if only for testability, but probably of
little practical value.  We default to hardlinked clone for
everyday use, and paranoids can use --no-hardlinks as a way to
make a back-up.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 23:42:36 -07:00
Linus Torvalds 72a4f4b657 connect: accept file:// URL scheme
We might make it something like: "if you use an url, we don't default to
local", so the difference would be that

	git clone file:///directory/to/repo

would work the way it does now, but

	git clone /directory/to/repo

would default to "-l" behaviour. That kind of would make sense (and should
be easy to implement.

This adds support for "file://" URL to underlying connect
codepath to make it happen.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 21:51:20 -07:00
David Kastrup 50cff52f1a When generating manpages, delete outdated targets first.
This makes "make doc" work even if you made "sudo make doc" previously
by mistake.  Apparently an oversight: the other targets did this already.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 19:52:17 -07:00
Johannes Schindelin c9e6589288 rebase -i: fix for optional [branch] parameter
When calling "git rebase -i <upstream> <branch>", git should switch
to <branch> first.  This worked before, but I broke it by my
"Shut git rebase -i up" patch.

Fix that, and add a test to make sure that it does not break again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 18:17:56 -07:00
Steve Hoelzer 434e6ef89d Try to be consistent with capitalization in the documentation
Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 18:15:43 -07:00
Junio C Hamano 6d4bbebd35 git-commit.sh: Permit the --amend message to be given with -m/-c/-C/-F.
[jc: adjusted t/t7501 as this makes -F and --amend compatible]

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 18:15:43 -07:00
David Kastrup 08874658b4 git-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commands
The previous code only allowed specifying a single executable rather
than a complete command like "emacsclient --alternate-editor vi" in
those variables.  Since VISUAL/EDITOR appear to be traditionally
passed to a shell for interpretation (as corroborated with "less",
"mail" and "mailx", while the really ancient "more" indeed allows only
an executable name), the shell function git_editor has been amended
appropriately.

"eval" is employed to have quotes and similar interpreted _after_
expansion, so that specifying
EDITOR='"/home/dak/My Commands/notepad.exe"'
can be used for actually using commands with blanks.

Instead of passing just the first argument of git_editor on, we pass
all of them (so that +lineno might be employed at a later point of
time, or so that multiple files may be edited when appropriate).

Strictly speaking, there is a change in behavior: when
git config core.editor
returns a valid but empty string, the fallbacks are still searched.
This is more consistent, and the old code was problematic with regard
to multiple blanks.  Putting in additional quotes might have worked,
but quotes inside of command substitution inside of quotes is nasty
enough to not reliably work the same across "Bourne shells".

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 18:00:17 -07:00
Alex Riesen 21e9757e31 Hack git-add--interactive to make it work with ActiveState Perl
It wont work for arguments with special characters (like ", : or *).
It is generally not possible on Windows, so I didn't even try.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 17:58:12 -07:00
Johannes Schindelin 96ffe892e3 rebase -i: ignore patches that are already in the upstream
Non-interactive rebase had this from the beginning -- match it by
using --cherry-pick option to rev-list.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 17:56:28 -07:00
Johannes Schindelin 420acb31ac get_relative_cwd(): clarify why it handles dir == NULL
The comment did not make a good case why it makes sense.
Clarify, and remove stale comment about the caller being lazy.
The behaviour on NULL input is pretty much intentional.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 11:34:13 -07:00
Johannes Schindelin e90fdc39b6 Clean up work-tree handling
The old version of work-tree support was an unholy mess, barely readable,
and not to the point.

For example, why do you have to provide a worktree, when it is not used?
As in "git status".  Now it works.

Another riddle was: if you can have work trees inside the git dir, why
are some programs complaining that they need a work tree?

IOW it is allowed to call

	$ git --git-dir=../ --work-tree=. bla

when you really want to.  In this case, you are both in the git directory
and in the working tree.  So, programs have to actually test for the right
thing, namely if they are inside a working tree, and not if they are
inside a git directory.

Also, GIT_DIR=../.git should behave the same as if no GIT_DIR was
specified, unless there is a repository in the current working directory.
It does now.

The logic to determine if a repository is bare, or has a work tree
(tertium non datur), is this:

--work-tree=bla overrides GIT_WORK_TREE, which overrides core.bare = true,
which overrides core.worktree, which overrides GIT_DIR/.. when GIT_DIR
ends in /.git, which overrides the directory in which .git/ was found.

In related news, a long standing bug was fixed: when in .git/bla/x.git/,
which is a bare repository, git formerly assumed ../.. to be the
appropriate git dir.  This problem was reported by Shawn Pearce to have
caused much pain, where a colleague mistakenly ran "git init" in "/" a
long time ago, and bare repositories just would not work.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 00:38:31 -07:00
Johannes Schindelin d7ac12b25d Add set_git_dir() function
With the function set_git_dir() you can reset the path that will
be used for git_path(), git_dir() and friends.

The responsibility to close files and throw away information from the
old git_dir lies with the caller.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 00:38:31 -07:00
Johannes Schindelin e663674722 Add functions get_relative_cwd() and is_inside_dir()
The function get_relative_cwd() works just as getcwd(), only that it
takes an absolute path as additional parameter, returning the prefix
of the current working directory relative to the given path.  If the
cwd is no subdirectory of the given path, it returns NULL.

is_inside_dir() is just a trivial wrapper over get_relative_cwd().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 00:38:30 -07:00
Johannes Schindelin e5392c5146 Add is_absolute_path() and make_absolute_path()
This patch adds convenience functions to work with absolute paths.
The function is_absolute_path() should help the efforts to integrate
the MinGW fork.

Note that make_absolute_path() returns a pointer to a static buffer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 00:38:30 -07:00
Jens Axboe 73a7a65663 --base-path-relaxed option
I switched git.kernel.dk to --base-path a few minutes ago, to get rid of
a /data/git postfix in the posted urls. But transitioning is tricky,
since now all old paths will fail miserably.

So I added this --base-path-relaxed option, that will make git-daemon
try the absolute path without prefixing --base-path before giving up.
With this in place and --base-path-relaxed added, both my new url of

    git://git.kernel.dk/linux-2.6-block.git

and the old

    git://git.kernel.dk/data/git/linux-2.6-block.git

work fine.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 00:37:23 -07:00
Kristian Høgsberg 12ace0b20d Add test case for basic commit functionality.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 23:10:26 -07:00
Alexandre Julliard 274e13e0e9 git.el: Take into account the core.excludesfile config option.
Also don't require .git/info/exclude to exist in order to list unknown
files.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 23:05:43 -07:00
Alexandre Julliard 61988f1127 git.el: Avoid using ewoc-set-data for compatibility with Emacs 21.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 23:04:10 -07:00
Alex Riesen be52a41c4e Make verse of git-config manpage more readable
Also mention '--file' in FILES.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 22:56:15 -07:00
Alex Riesen 773a69fb09 Add a test for git-config --file
Check for non-0 exit code if the confiog file does not exist and
if it works exactly like when setting GIT_CONFIG.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 22:56:15 -07:00
Alex Riesen 67d454fed6 Add an option to specify a file to config builtin
There are (really!) systems where using environment variables is very
cumbersome (yes, Windows, it has problems unsetting them). Besides this
form is shorter.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 22:56:15 -07:00
Robert Schiele 10861beaa8 make the name of the library directory a config option
Introduce new makefile variable lib to hold the name of the lib
directory ("lib" by default).  Also introduce a switch for configure
to specify this name with --with-lib=ARG.  This is useful for systems
that use a different name than "lib" (like "lib64" on some 64 bit
Linux architectures).

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 22:36:55 -07:00
Junio C Hamano 4b7f59af2a Merge branch 'maint'
* maint:
  rev-list --bisect: fix allocation of "int*" instead of "int".
2007-07-31 21:12:32 -07:00
Christian Couder 4e0b2bbc57 rev-list --bisect: fix allocation of "int*" instead of "int".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 21:07:39 -07:00
Junio C Hamano cf32190aa6 git.c: execution path
The comment before executing git subcommands were stale and confusing.
Noticed by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 02:06:14 -07:00
Robert Schiele bef19da9b6 add option to find zlib in custom path
Some systems do not provide zlib development headers and libraries in
default search path of the compiler.  For these systems we should allow
specifying the location by --with-zlib=PATH or by setting ZLIB_PATH in
the makefile.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 01:23:43 -07:00