gitweb.git
stash save: fix parameter handlingJunio C Hamano Wed, 23 Jul 2008 20:33:44 +0000 (13:33 -0700)

stash save: fix parameter handling

A command line "git stash save --keep-index I was doing this" was
misparsed and keep-index codepath did not trigger.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am: Add colon before the subject that is printed... Stephan Beyer Wed, 23 Jul 2008 16:46:36 +0000 (18:46 +0200)

git-am: Add colon before the subject that is printed out as being applied

git-am output can be confusing, because the subject of the applied
patch can look like the rest of a sentence starting with "Applying".
The added colon should make this clearer.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: When an 'edit' stops, mention the commitJohannes Sixt Wed, 23 Jul 2008 07:46:35 +0000 (09:46 +0200)

rebase -i: When an 'edit' stops, mention the commit

In a rebase session where more than one commit is to be 'edit'ed, and the
user spends considerable time to 'edit' a commit, it is easy to forget what
one wanted to 'edit' at the individual commits. It would be helpful to see
at which commit the rebase stopped.

Incidentally, if the rebase stopped due to merge conflicts or other errors,
the commit was already reported ("Could not apply $sha1..."), but when
rebase stopped after successfully applying an "edit" commit, it would not
mention it. With this change the commit is reported.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sort_in_topological_order(): avoid setting a commit... Johannes Schindelin Wed, 23 Jul 2008 00:51:36 +0000 (01:51 +0100)

sort_in_topological_order(): avoid setting a commit flag

We used to set the TOPOSORT flag of commits during the topological
sorting, but we can just as well use the member "indegree" for it:
indegree is now incremented by 1 in the cases where the commit used
to have the TOPOSORT flag.

This is the same behavior as before, since indegree could not be
non-zero when TOPOSORT was unset.

Incidentally, this fixes the bug in show-branch where the 8th column
was not shown: show-branch sorts the commits in topological order,
assuming that all the commit flags are available for show-branch's
private matters.

But this was not true: TOPOSORT was identical to the flag corresponding
to the 8th ref. So the flags for the 8th column were unset by the
topological sorting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add test to show that show-branch misses out the 8th... Johannes Schindelin Wed, 23 Jul 2008 00:50:35 +0000 (01:50 +0100)

Add test to show that show-branch misses out the 8th column

Noticed by Pasky.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ignore dirty submodule states in "git pull --rebase"Johannes Schindelin Tue, 22 Jul 2008 21:41:41 +0000 (22:41 +0100)

Ignore dirty submodule states in "git pull --rebase"

This is a companion patch to 6848d58c(Ignore dirty submodule states
during rebase and stash).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t4202-log.sh: add newline at end of fileBrandon Casey Tue, 22 Jul 2008 21:23:31 +0000 (16:23 -0500)

t/t4202-log.sh: add newline at end of file

Some shells hang when parsing the script if the last statement is not
followed by a newline. So add one.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7502-commit.sh: rearrange test to make more portableBrandon Casey Tue, 22 Jul 2008 21:21:10 +0000 (16:21 -0500)

t7502-commit.sh: rearrange test to make more portable

Some shells have problems with one-shot environment variable export
and function calls. The sequence is rearranged to avoid the one-shot
and to allow the test script to be linked together with '&&'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3200,t7201: replace '!' with test_must_failBrandon Casey Tue, 22 Jul 2008 21:16:54 +0000 (16:16 -0500)

t3200,t7201: replace '!' with test_must_fail

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4116-apply-reverse.sh: use $TAR rather than tarBrandon Casey Tue, 22 Jul 2008 21:16:25 +0000 (16:16 -0500)

t4116-apply-reverse.sh: use $TAR rather than tar

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/: Replace diff [-u|-U0] with test_cmp to allow compil... Brandon Casey Tue, 22 Jul 2008 21:17:43 +0000 (16:17 -0500)

t/: Replace diff [-u|-U0] with test_cmp to allow compilation with old diff

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7601: extend the 'merge picks up the best result'... Miklos Vajna Tue, 22 Jul 2008 17:05:59 +0000 (19:05 +0200)

t7601: extend the 'merge picks up the best result' test

The test only checked if the best result picking code works if there are
multiple strategies set in the config. Add a similar one that tests if
the same true if the -s option of git merge was used multiple times.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

In perforce, RCS keywords are case-sensitiveDaniel Barkalow Tue, 22 Jul 2008 16:48:57 +0000 (12:48 -0400)

In perforce, RCS keywords are case-sensitive

At least, this is true in 2007.2, according to the documentation.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Allow pager of diff command be enabled/disabledAlex Riesen Mon, 21 Jul 2008 21:28:49 +0000 (23:28 +0200)

Allow pager of diff command be enabled/disabled

See for example, status and show commands. Besides,
Documentation/RelNotes-1.6.0.txt mentions that pager.<cmd>
can be used to enable/disable paging behavior per command.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix two leftovers from path_list->string_listJohannes Schindelin Tue, 22 Jul 2008 11:09:47 +0000 (13:09 +0200)

Fix two leftovers from path_list->string_list

In the documentation, where you cannot get compile errors for using the
wrong member name, there were two mentions of 'path' left.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git am --skip: clean the index while preserving local... Olivier Marin Mon, 21 Jul 2008 13:39:06 +0000 (15:39 +0200)

git am --skip: clean the index while preserving local changes

In 3-way merge, "am" will let the index with unmerged path waiting
for us to resolve conflicts and continue. But if we want to --skip
instead, "am" refuses to continue because of the dirty index.

With this patch, "am" will clean the index without touching files
locally modified, before continuing.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-submodule: move ill placed shift.Pierre Habouzit Mon, 21 Jul 2008 18:15:59 +0000 (20:15 +0200)

git-submodule: move ill placed shift.

When running git submodule update -i, the "-i" is shifted before recursing
into cmd_init and then again outside of the loop. This causes some /bin/sh
to complain about shifting when there are no arguments left (and would
discard anything written after -i too).

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-merge: add missing structure initializationPierre Habouzit Tue, 22 Jul 2008 05:32:53 +0000 (22:32 -0700)

builtin-merge: add missing structure initialization

The parameter that is eventually passed to read_directory() to scan the
working tree should be properly initialized.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-merge: give a proper error message for invalid... Miklos Vajna Mon, 21 Jul 2008 16:10:47 +0000 (18:10 +0200)

builtin-merge: give a proper error message for invalid strategies in config

'git merge -s foobar' diagnosed invalid "foobar" strategy and errored out
with a message, but foobar in pull.twohead or pull.octopus was just
silently ignored. This makes invalid strategy both on the command line
and in the configuration file to trigger the same error.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: do not rely on external "patch"Junio C Hamano Sun, 20 Jul 2008 08:33:46 +0000 (01:33 -0700)

tests: do not rely on external "patch"

Some of our tests assumed a working "patch" command to produce expected
results when checking "git-apply", but some systems have broken "patch".

We can compare our output with expected output that is precomputed
instead to sidestep this issue.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Don't cut off last character of commit descriptions.Nikolaj Schumacher Mon, 30 Jun 2008 10:08:16 +0000 (12:08 +0200)

Don't cut off last character of commit descriptions.

This should have been part of 24a2293 (git-blame.el: show the when, who
and what in the minibuffer., 2008-02-12), that changed from using
--pretty=oneline to --pretty=format:... without terminating newline.

Acked-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options: fix segmentation fault when a required... Olivier Marin Mon, 21 Jul 2008 18:30:36 +0000 (20:30 +0200)

parse-options: fix segmentation fault when a required value is missing

p->argc represent the number of arguments that have not been parsed yet,
_including_ the one we are currently parsing. If it is not greater than
one then there is no more argument.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Acked-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo: better parse email adresses containg parenthesesPhilippe Bruhat (BooK) Mon, 21 Jul 2008 13:34:29 +0000 (15:34 +0200)

mailinfo: better parse email adresses containg parentheses

When using git-rebase, author fields containing a ')' at the last position
had the close-parens character removed; the removal should be done only
when it is of this form:

user@host (User Name)

i.e. the remainder after stripping the e-mail address part is enclosed in
a parentheses pair as a whole, not for addresses like this:

User Name (me) <user@host>

Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org>
Acked-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am: remove dash from help messageOlivier Marin Mon, 21 Jul 2008 14:12:20 +0000 (16:12 +0200)

git-am: remove dash from help message

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "make git-status use a pager"Junio C Hamano Tue, 22 Jul 2008 02:41:17 +0000 (19:41 -0700)

Revert "make git-status use a pager"

This reverts commit c8af1de9cfa0a5678ae766777e0f905e60b69fda.

The change was immensely unpopular, and poeple who would really want to
page can use pager.status configuration.

git-diff(1): "--c" -> "--cc" typo fixJonathan Nieder Mon, 21 Jul 2008 18:34:06 +0000 (13:34 -0500)

git-diff(1): "--c" -> "--cc" typo fix

git diff does not take a --c option.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Rename path_list to string_listJohannes Schindelin Mon, 21 Jul 2008 18:03:49 +0000 (19:03 +0100)

Rename path_list to string_list

The name path_list was correct for the first usage of that data structure,
but it really is a general-purpose string list.

$ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list)
$ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list)
$ git mv path-list.h string-list.h
$ git mv path-list.c string-list.c
$ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path)
$ perl -i -pe 's/path/string/g' string-list.[ch]
$ git mv Documentation/technical/api-path-list.txt \
Documentation/technical/api-string-list.txt
$ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths)

... and then fix all users of string-list to access the member "string"
instead of "path".

Documentation/technical/api-string-list.txt needed some rewrapping, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Rename .git/rebase to .git/rebase-applyJohannes Schindelin Mon, 21 Jul 2008 10:51:02 +0000 (12:51 +0200)

Rename .git/rebase to .git/rebase-apply

With git-am, it sounds awkward to have the patches in ".git/rebase/",
but for technical reasons, we have to keep the same directory name
for git-am and git-rebase. ".git/rebase-apply" seems to be a good
compromise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update my e-mail addressJunio C Hamano Mon, 21 Jul 2008 19:14:42 +0000 (12:14 -0700)

Update my e-mail address

The old cox.net address is still getting mails from gitters.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ap/trackinfo' v1.6.0-rc0Junio C Hamano Mon, 21 Jul 2008 01:00:27 +0000 (18:00 -0700)

Merge branch 'ap/trackinfo'

* ap/trackinfo:
Reword "your branch has diverged..." lines to reduce line length

Merge branch 'jc/rerere-auto-more'Junio C Hamano Mon, 21 Jul 2008 01:00:17 +0000 (18:00 -0700)

Merge branch 'jc/rerere-auto-more'

* jc/rerere-auto-more:
rerere.autoupdate: change the message when autoupdate is in effect

Merge branch 'ns/am-abort'Junio C Hamano Mon, 21 Jul 2008 01:00:13 +0000 (18:00 -0700)

Merge branch 'ns/am-abort'

* ns/am-abort:
git am --abort

Merge branch 'jc/add-addremove'Junio C Hamano Mon, 21 Jul 2008 00:53:17 +0000 (17:53 -0700)

Merge branch 'jc/add-addremove'

* jc/add-addremove:
git-add --all: documentation
git-add --all: tests
git-add --all: add all files
builtin-add.c: restructure the code for maintainability

Conflicts:
builtin-add.c

"needs update" considered harmfulJunio C Hamano Sun, 20 Jul 2008 07:21:38 +0000 (00:21 -0700)

"needs update" considered harmful

"git update-index --refresh", "git reset" and "git add --refresh" have
reported paths that have local modifications as "needs update" since the
beginning of git.

Although this is logically correct in that you need to update the index at
that path before you can commit that change, it is now becoming more and
more clear, especially with the continuous push for user friendliness
since 1.5.0 series, that the message is suboptimal. After all, the change
may be something the user might want to get rid of, and "updating" would
be absolutely a wrong thing to do if that is the case.

I prepared two alternatives to solve this. Both aim to reword the message
to more neutral "locally modified".

This patch is a more intrusive variant that changes the message for only
Porcelain commands ("add" and "reset") while keeping the plumbing
"update-index" intact.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Move read_in_full() and write_in_full() to wrapper.cJunio C Hamano Sun, 20 Jul 2008 23:13:05 +0000 (16:13 -0700)

Move read_in_full() and write_in_full() to wrapper.c

A few compat/* layer functions call these functions, but we would really
want to keep them thin, without depending too much on the libgit proper.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Link shell with compat layer functionsJunio C Hamano Sun, 20 Jul 2008 22:58:13 +0000 (15:58 -0700)

Link shell with compat layer functions

This in the short term will break on platforms that use compat implemenations
that call outside compat layer, but that is exactly what we want. To give
incentive to fix things for people who are affected and more importantly have
environment to test their fixes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 21 Jul 2008 00:16:29 +0000 (17:16 -0700)

Merge branch 'maint'

* maint:
fix usage string for git grep
refresh-index: fix bitmask assignment

Conflicts:
builtin-grep.c

git-svn: fix git svn info to work without argumentsDmitry Potapov Sun, 20 Jul 2008 20:14:07 +0000 (00:14 +0400)

git-svn: fix git svn info to work without arguments

commit 2fe403e7452bd6e1e8232445cf5434ce8f1af973 broke "git-svn info ."
due to replacing '.' with '' in canonicalize_path for the top directory,
while find_file_type_and_diff_status was not corrected.

Bug reports:

http://thread.gmane.org/gmane.comp.version-control.git/87822/
http://bugs.debian.org/490400

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-push.c: Cleanup - use OPT_BIT() and remove... Michele Ballabio Sun, 20 Jul 2008 12:02:20 +0000 (14:02 +0200)

builtin-push.c: Cleanup - use OPT_BIT() and remove some variables

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-merge.c: Fix option parsingMichele Ballabio Sun, 20 Jul 2008 12:34:47 +0000 (14:34 +0200)

builtin-merge.c: Fix option parsing

Now "git merge -m" needs a message, and errors out with the usage
text if none is given.
This way, t7600-merge.sh is fixed.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix usage string for git grepJonathan Nieder Sun, 20 Jul 2008 19:13:08 +0000 (14:13 -0500)

fix usage string for git grep

Without this patch, git-grep gives confusing usage information:

$ git grep --confused
usage: git grep <option>* <rev>* [-e] <pattern> [<path>...]
$ git grep HEAD pattern
fatal: ambiguous argument 'pattern': unknown revision or path no
t in the working tree.
Use '--' to separate paths from revisions

So put <pattern> before the <rev>s, in accordance with actual correct
usage. While we're changing the usage string, we might as well include
the "--" separating revisions and paths, too.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Teach 'git merge' that some merge strategies no longer... Miklos Vajna Sun, 20 Jul 2008 12:12:48 +0000 (14:12 +0200)

Teach 'git merge' that some merge strategies no longer exist

'recur' co-existed with 'recursive' when rewriting it in C, but it no
longer available. 'stupid' was also recently removed.

"git merge -s confused origin" still includes them in the list of
available merge strategies.

[jc: this is a squash of two micropatches]

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Add testsuite for packed refsLars Noschinski Thu, 17 Jul 2008 17:00:28 +0000 (19:00 +0200)

cvsserver: Add testsuite for packed refs

Check that req_update shows refs, even if all refs are packed.

Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refresh-index: fix bitmask assignmentJunio C Hamano Sun, 20 Jul 2008 06:25:00 +0000 (23:25 -0700)

refresh-index: fix bitmask assignment

5fdeacb (Teach update-index about --ignore-submodules, 2008-05-14) added a
new refresh option flag but did not assign a unique bit for it correctly,
and broke "update-index --ignore-missing".

This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-add --all: documentationJunio C Hamano Sun, 20 Jul 2008 05:34:16 +0000 (22:34 -0700)

git-add --all: documentation

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-add --all: testsJunio C Hamano Sun, 20 Jul 2008 03:32:38 +0000 (20:32 -0700)

git-add --all: tests

And here is a small test script that makes sure that:

- both modified and new files are included,
- removed file is noticed, and
- no ignored file is included.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-add --all: add all filesJunio C Hamano Sun, 20 Jul 2008 02:51:11 +0000 (19:51 -0700)

git-add --all: add all files

People sometimes find that "git add -u && git add ." are 13 keystrokes too
many. This reduces it by nine.

The support of this has been very low priority for me personally, because
I almost never do "git add ." in a directory with already tracked files,
and in a new directory, there is no point saying "git add -u".

However, for two types of people (that are very different from me), this
mode of operation may make sense and there is no reason to leave it
unsupported. That is:

(1) If you are extremely well disciplined and keep perfect .gitignore, it
always is safe to say "git add ."; or

(2) If you are extremely undisciplined and do not even know what files
you created, and you do not very much care what goes in your history,
it does not matter if "git add ." included everything.

So there it is, although I suspect I will not use it myself, ever.

It will be too much of a change that is against the expectation of the
existing users to allow "git commit -a" to include untracked files, and
it would be inconsistent if we named this new option "-a", so the short
option is "-A". We _might_ want to later add "git commit -A" but that is
a separate topic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-add.c: restructure the code for maintainabilityJunio C Hamano Sun, 20 Jul 2008 02:22:25 +0000 (19:22 -0700)

builtin-add.c: restructure the code for maintainability

The implementation of "git add" has four major codepaths that are mutually
exclusive:

- if "--interactive" or "--patch" is given, spawn "git add--interactive"
and exit without doing anything else. Otherwise things are handled
internally in this C code;

- if "--update" is given, update the modified files and exit without
doing anything else;

- if "--refresh" is given, do refresh and exit without doing anything
else;

- otherwise, find the paths that match pathspecs and stage their
contents.

It led to an unholy mess in the code structure; each of the latter three
codepaths has a separate call to read_cache(), even though they are all
about "read the current index, update it and write it back", and logically
they should read the index once _anyway_.

This cleans up the latter three cases by introducing a pair of helper
variables:

- "add_new_files" is set if we need to scan the working tree for paths
that match the pathspec. This variable is false for "--update" and
"--refresh", because they only work on already tracked files.

- "require_pathspec" is set if the user must give at least one pathspec.
"--update" does not need it but all the other cases do.

This is in preparation for introducing a new option "--all", that does the
equivalent of "git add -u && git add ." (aka "addremove").

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Getting closer to 1.6.0-rc0Junio C Hamano Sat, 19 Jul 2008 22:52:12 +0000 (15:52 -0700)

Getting closer to 1.6.0-rc0

Update the links to "stale" versions of documentation to link to 1.5.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git am --abortNanako Shiraishi Wed, 16 Jul 2008 10:39:10 +0000 (19:39 +0900)

git am --abort

After failing to apply patches in the middle of a series, "git am --abort"
lets you go back to the original commit.

[jc: doc/help update from Olivier, and fixups for "am -3" squashed in]

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 19 Jul 2008 18:28:06 +0000 (11:28 -0700)

Merge branch 'maint'

* maint:
GIT 1.5.6.4
builtin-rm: fix index lock file path
http-fetch: do not SEGV after fetching a bad pack idx file
rev-list: honor --quiet option
api-run-command.txt: typofix

Support gitlinks in fast-import.Alexander Gavrilov Sat, 19 Jul 2008 12:21:24 +0000 (16:21 +0400)

Support gitlinks in fast-import.

Currently fast-import/export cannot be used for
repositories with submodules. This patch extends
the relevant programs to make them correctly
process gitlinks.

Links can be represented by two forms of the
Modify command:

M 160000 SHA1 some/path

which sets the link target explicitly, or

M 160000 :mark some/path

where the mark refers to a commit. The latter
form can be used by importing tools to build
all submodules simultaneously in one physical
repository, and then simply fetch them apart.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

.mailmap updateJunio C Hamano Sat, 19 Jul 2008 06:24:26 +0000 (23:24 -0700)

.mailmap update

A few people sent in patches under slightly different spelling recently.
Hopefully this catches most of them if not all (with help from Dscho).

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-merge.txt: Partial rewrite of How... Petr Baudis Sat, 19 Jul 2008 18:17:22 +0000 (20:17 +0200)

Documentation/git-merge.txt: Partial rewrite of How Merge Works

The git-merge documentation's "HOW MERGE WORKS" section is confusingly
composed and actually omits the most interesting part, the merging of
the arguments into HEAD itself, surprisingly not actually mentioning
the fast-forward merge anywhere.

This patch replaces the "[NOTE]" screenful of highly technical details
by a single sentence summing up the interesting information, and instead
explains how are the arguments compared with HEAD and the three possible
inclusion states that are named "Already up-to-date", "Fast-forward"
and "True merge". It also makes it clear that the rest of the section
talks only about the true merge situation, and slightly expands the
talk on solving conflicts.

Junio initiated the removal of the Note screenful altogether and
offered many stylistical fixes.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: remove unused headersRené Scharfe Fri, 18 Jul 2008 14:30:47 +0000 (16:30 +0200)

archive: remove unused headers

Remove obsolete #includes.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: make zip compression level independent from... René Scharfe Fri, 18 Jul 2008 14:30:32 +0000 (16:30 +0200)

archive: make zip compression level independent from core git

zlib_compression_level is the compression level used for git's object store.
It's 1 by default, which is the fastest setting. This variable is also used
as the default compression level for ZIP archives created by git archive.

For archives, however, zlib's own default of 6 is more appropriate, as it's
favouring small size over speed -- archive creation is not that performance
critical most of the time.

This patch makes git archive independent from git's internal compression
level setting. It affects invocations of git archive without explicitly
specified compression level option, only.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: How to ignore local changes in tracked... Petr Baudis Fri, 18 Jul 2008 14:11:07 +0000 (16:11 +0200)

Documentation: How to ignore local changes in tracked files

This patch explains more carefully that `.gitignore` concerns only
untracked files and refers the reader to

git update-index --assume-unchanged

in the need of ignoring uncommitted changes in already tracked files.
The description of this option is lifted to a more "porcelainish"
level and explains the caveats of this usecase.

Whether feasible or not, I believe adding this functionality to
the porcelain is out of the scope of this patch. (And I personally
think that referring to the plumbing in the case of such a special
usage is fine.)

This is currently probably one of the top FAQs at #git and the
--assume-unchanged switch is not widely known; gitignore(5) is the first
place where people are likely to look for it.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-submodule.txt: Further clarify the... Petr Baudis Fri, 18 Jul 2008 13:40:41 +0000 (15:40 +0200)

Documentation/git-submodule.txt: Further clarify the description

This patch rewrites the general description yet again, first clarifying
the high-level concept, mentioning the difference to remotes and using
the subtree merge strategy, then getting to the details about tree
entries and .gitmodules file.

The patch also makes few smallar grammar fixups within the rest of the
description and clarifies how does 'init' relate to 'update --init'.

Cc: Heikki Orsila <shdl@zakalwe.fi>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add ANSI control code emulation for the Windows consolePeter Harris Fri, 18 Jul 2008 07:34:44 +0000 (09:34 +0200)

Add ANSI control code emulation for the Windows console

This adds only the minimum necessary to keep git pull/merge's diffstat from
wrapping. Notably absent is support for the K (erase) operation, and support
for POSIX write.

Signed-off-by: Peter Harris <git@peter.is-a-geek.org>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-clone: rewrite guess_dir_name()Johannes Sixt Sat, 19 Jul 2008 09:32:45 +0000 (11:32 +0200)

builtin-clone: rewrite guess_dir_name()

The function has to do three small and independent tasks, but all of them
were crammed into a single loop. This rewrites the function entirely by
unrolling these tasks.

We also now use is_dir_sep(c) instead of c == '/' to increase portability.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Teach lookup_prog not to select directoriesEric Raible Fri, 18 Jul 2008 07:34:42 +0000 (09:34 +0200)

Teach lookup_prog not to select directories

Without this simple fix "git gui" in the git source directory
finds the git-gui directory instead of the tcl script in /usr/bin.

Signed-off-by: Eric Raible <raible@gmail.com>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

testsuite for cvs co -cFabian Emmes Thu, 17 Jul 2008 17:00:30 +0000 (19:00 +0200)

testsuite for cvs co -c

Check that all branches are displayed.

Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>
Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Add cvs co -c supportLars Noschinski Thu, 17 Jul 2008 17:00:29 +0000 (19:00 +0200)

cvsserver: Add cvs co -c support

Implement cvs checkout's -c option by returning a list of all "modules".
This is more useful than displaying a perl warning if -c is given.

Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Add support for packed refsLars Noschinski Thu, 17 Jul 2008 17:00:27 +0000 (19:00 +0200)

cvsserver: Add support for packed refs

req_update still parses /refs/heads manually. Replace this by
a call to show-ref.

Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Testsuite: Unset CVS_SERVERFabian Emmes Thu, 17 Jul 2008 17:00:26 +0000 (19:00 +0200)

Testsuite: Unset CVS_SERVER

The CVS_SERVER environment variable can cause some of the cvsimport tests
to fail. So unset this variable at the beginning of the test script.

Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>
Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Link git-shell only to a subset of libgit.aStephan Beyer Fri, 18 Jul 2008 01:04:30 +0000 (03:04 +0200)

Link git-shell only to a subset of libgit.a

Commit 5b8e6f85 introduced stubs for three functions that make no sense
for git-shell. But those stubs defined libgit.a functions a second time
so that a linker can complain.

Now git-shell is only linked to a subset of libgit.a.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9001 (send-email): Do not use hardcoded /bin/sh in... Junio C Hamano Fri, 18 Jul 2008 06:18:43 +0000 (23:18 -0700)

t9001 (send-email): Do not use hardcoded /bin/sh in test

Scriptlets used form inside this test began with hardcoded "#!/bin/sh".
By setting SHELL_PATH the user is already telling us that what the vendor
has in /bin/sh isn't POSIX enough, and we really should try to honor that
request.

Originally noticed by SungHyun Nam who later tested this patch and
verified that it fixes the issue on Solaris 9.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

GIT 1.5.6.4 v1.5.6.4Junio C Hamano Sat, 19 Jul 2008 17:58:01 +0000 (10:58 -0700)

GIT 1.5.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-rm: fix index lock file pathOlivier Marin Sat, 19 Jul 2008 16:24:46 +0000 (18:24 +0200)

builtin-rm: fix index lock file path

When hold_locked_index() is called with a relative git_dir and you are
outside the work tree, the lock file become relative to the current
directory. So when later setup_work_tree() change the current directory
it breaks lock file path and commit_locked_index() fails.

This patch move index locking code after setup_work_tree() call to make
lock file relative to the working tree as it should be and add a test
case.

Noticed by Nick Andrew.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'sp/maint-index-pack' into maintJunio C Hamano Fri, 18 Jul 2008 22:39:51 +0000 (15:39 -0700)

Merge branch 'sp/maint-index-pack' into maint

* sp/maint-index-pack:
index-pack: Honor core.deltaBaseCacheLimit when resolving deltas
index-pack: Track the object_entry that creates each base_data
index-pack: Chain the struct base_data on the stack for traversal
index-pack: Refactor base arguments of resolve_delta into a struct

http-fetch: do not SEGV after fetching a bad pack idx... Junio C Hamano Fri, 18 Jul 2008 07:11:40 +0000 (00:11 -0700)

http-fetch: do not SEGV after fetching a bad pack idx file

Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-list: honor --quiet optionJunio C Hamano Fri, 18 Jul 2008 05:39:09 +0000 (22:39 -0700)

rev-list: honor --quiet option

Nick Andrew noticed that rev-list lets --quiet option to be parsed by
underlying diff_options parser but did not pick up the result. This
resulted in --quiet option to become effectively a no-op.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-remote.c: fix earlier "skip_prefix()" conversionJunio C Hamano Fri, 18 Jul 2008 04:30:33 +0000 (21:30 -0700)

builtin-remote.c: fix earlier "skip_prefix()" conversion

The original code relied on an insane definition of skip_prefix() that
returned an empty string for a NULL input and returned the original if the
given "prefix" is not a prefix at all (it would have been justifiable if
it were called "come_up_with_a_short_name_to_report_ref()" or something,
though). In any case, when we replaced it with a more saner definition of
the function whose behaviour is true to its name, its callers needed to be
adjusted but the conversion missed one call site.

This introduces a helper function "abbrev_ref()" whose purpose is to get a
full refname and its possible prefix and to strip the prefix part if it
matches, or refname itself in full if it doesn't. This makes the callers
easier to read again.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

api-run-command.txt: typofixStephan Beyer Thu, 17 Jul 2008 23:53:55 +0000 (01:53 +0200)

api-run-command.txt: typofix

Replace "run_command_v_opt_dir" by "run_command_v_opt_cd".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/RelNotes-1.6.0.txt: Expand on the incompa... Petr Baudis Thu, 17 Jul 2008 17:01:30 +0000 (19:01 +0200)

Documentation/RelNotes-1.6.0.txt: Expand on the incompatible packfiles

Note that v1.4.4.5 supports pack index v2, and describe how to keep
your repositories backwards-compatible, shall you need to.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere.autoupdate: change the message when autoupdate... Junio C Hamano Thu, 17 Jul 2008 03:25:18 +0000 (20:25 -0700)

rerere.autoupdate: change the message when autoupdate is in effect

This changes the message rerere issues after reusing previous conflict
resolution from "Resolved" to "Staged" when autoupdate option is in
effect.

It is envisioned that in practice, some auto resolitions are trickier and
iffier than others, and we would want to add a feature to mark individual
resolutions as "this is ok to autoupdate" or "do not autoupdate the result
using this resolution even when rerere.autoupdate is in effect" in the
future. When that happens, these messages will make the distinction
clearer.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo: off-by-one fix for [PATCH (foobar)] removal... Junio C Hamano Thu, 17 Jul 2008 05:42:04 +0000 (22:42 -0700)

mailinfo: off-by-one fix for [PATCH (foobar)] removal from Subject: line

A patch title "[PATCH] 1" was sanitized by the original code by stripping
the "[PATCH]" from the front, but after the conversion to use strbuf this
behaviour was broken due to a counting error.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache.c: typofixJunio C Hamano Thu, 17 Jul 2008 01:48:58 +0000 (18:48 -0700)

read-cache.c: typofix

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes for 1.6.0Junio C Hamano Thu, 17 Jul 2008 01:34:19 +0000 (18:34 -0700)

Update draft release notes for 1.6.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Reword "your branch has diverged..." lines to reduce... Avery Pennarun Wed, 16 Jul 2008 19:19:27 +0000 (15:19 -0400)

Reword "your branch has diverged..." lines to reduce line length

The message length depends on the length of the branch name. In my case,
the branch name "origin/add-chickens2" put the first line of the "your
branch has diverged" message over 80 characters, which triggered "less -FS"
to not exit automatically as expected.

This patch rewords the messages to make the lines generally shorter, so
that you'd need a significantly longer branch name to trigger the problem.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mv/dashless'Junio C Hamano Thu, 17 Jul 2008 00:49:59 +0000 (17:49 -0700)

Merge branch 'mv/dashless'

* mv/dashless:
make remove-dashes: apply to scripts and programs as well, not just to builtins
git-bisect: use dash-less form on git bisect log
t1007-hash-object.sh: use quotes for the test description
t0001-init.sh: change confusing directory name

Merge branch 'ls/mailinfo'Junio C Hamano Thu, 17 Jul 2008 00:49:53 +0000 (17:49 -0700)

Merge branch 'ls/mailinfo'

* ls/mailinfo:
git-mailinfo: use strbuf's instead of fixed buffers
Add some useful functions for strbuf manipulation.
Make some strbuf_*() struct strbuf arguments const.

Conflicts:
builtin-mailinfo.c

Documentation/git-submodule.txt: Add Description sectionPetr Baudis Wed, 16 Jul 2008 18:44:12 +0000 (20:44 +0200)

Documentation/git-submodule.txt: Add Description section

Figuring out how submodules work conceptually is quite a bumpy
ride for a newcomer; the user manual helps (if one knows to actually
look into it), but the reference documentation should provide good
quick intro as well. This patch attempts to do that, with suggestions
from Heikki Orsila.

Cc: Heikki Orsila <shdl@zakalwe.fi>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'sb/dashless'Junio C Hamano Thu, 17 Jul 2008 00:22:50 +0000 (17:22 -0700)

Merge branch 'sb/dashless'

* sb/dashless:
Make usage strings dash-less
t/: Use "test_must_fail git" instead of "! git"
t/test-lib.sh: exit with small negagive int is ok with test_must_fail

Conflicts:
builtin-blame.c
builtin-mailinfo.c
builtin-mailsplit.c
builtin-shortlog.c
git-am.sh
t/t4150-am.sh
t/t4200-rerere.sh

Merge branch 'rs/archive'Junio C Hamano Thu, 17 Jul 2008 00:12:18 +0000 (17:12 -0700)

Merge branch 'rs/archive'

* rs/archive:
archive: remove extra arguments parsing code
archive: unify file attribute handling
archive: centralize archive entry writing
archive: add baselen member to struct archiver_args
add context pointer to read_tree_recursive()
archive: remove args member from struct archiver

Merge branch 'ag/blame'Junio C Hamano Thu, 17 Jul 2008 00:12:11 +0000 (17:12 -0700)

Merge branch 'ag/blame'

* ag/blame:
Do not try to detect move/copy for entries below threshold.
Avoid rescanning unchanged entries in search for copies.

Merge branch 'rs/rebase-checkout-not-so-quiet'Junio C Hamano Thu, 17 Jul 2008 00:12:09 +0000 (17:12 -0700)

Merge branch 'rs/rebase-checkout-not-so-quiet'

* rs/rebase-checkout-not-so-quiet:
git-rebase: report checkout failure

Conflicts:
git-rebase.sh

Merge branch 'sp/maint-index-pack'Junio C Hamano Thu, 17 Jul 2008 00:11:18 +0000 (17:11 -0700)

Merge branch 'sp/maint-index-pack'

* sp/maint-index-pack:
index-pack: Honor core.deltaBaseCacheLimit when resolving deltas
index-pack: Track the object_entry that creates each base_data
index-pack: Chain the struct base_data on the stack for traversal
index-pack: Refactor base arguments of resolve_delta into a struct

Merge branch 'maint'Junio C Hamano Thu, 17 Jul 2008 00:10:28 +0000 (17:10 -0700)

Merge branch 'maint'

* maint:
Start preparing 1.5.6.4 release notes
git fetch-pack: do not complain about "no common commits" in an empty repo
rebase-i: keep old parents when preserving merges
t7600-merge: Use test_expect_failure to test option parsing
Fix buffer overflow in prepare_attr_stack
Fix buffer overflow in git diff
Fix buffer overflow in git-grep
git-cvsserver: fix call to nonexistant cleanupWorkDir()
Documentation/git-cherry-pick.txt et al.: Fix misleading -n description

Conflicts:
RelNotes

Start preparing 1.5.6.4 release notesJunio C Hamano Wed, 16 Jul 2008 22:55:51 +0000 (15:55 -0700)

Start preparing 1.5.6.4 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git fetch-pack: do not complain about "no common commit... Johannes Schindelin Wed, 2 Jul 2008 17:06:56 +0000 (18:06 +0100)

git fetch-pack: do not complain about "no common commits" in an empty repo

If the repo is empty, it is obvious that there are no common commits
when fetching from _anywhere_.

So there is no use in saying it in that case, and it can even be
annoying. Therefore suppress the message unilaterally if the repository
is empty prior to the fetch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/maint-pretty-mailmap' into maintJunio C Hamano Wed, 16 Jul 2008 22:27:03 +0000 (15:27 -0700)

Merge branch 'js/maint-pretty-mailmap' into maint

* js/maint-pretty-mailmap:
Add pretty format %aN which gives the author name, respecting .mailmap

Merge branch 'sp/maint-bash-completion-optim' into... Junio C Hamano Wed, 16 Jul 2008 22:25:24 +0000 (15:25 -0700)

Merge branch 'sp/maint-bash-completion-optim' into maint

* sp/maint-bash-completion-optim:
bash completion: Resolve git show ref:path<tab> losing ref: portion
bash completion: Append space after file names have been completed
bash completion: Don't offer "a.." as a completion for "a."
bash completion: Improve responsiveness of git-log completion

Merge branch 'sp/maint-pack-memuse' into maintJunio C Hamano Wed, 16 Jul 2008 22:24:07 +0000 (15:24 -0700)

Merge branch 'sp/maint-pack-memuse' into maint

* sp/maint-pack-memuse:
Correct pack memory leak causing git gc to try to exceed ulimit

Merge branch 'ls/maint-mailinfo-patch-label' into maintJunio C Hamano Wed, 16 Jul 2008 22:23:19 +0000 (15:23 -0700)

Merge branch 'ls/maint-mailinfo-patch-label' into maint

* ls/maint-mailinfo-patch-label:
git-mailinfo: Fix getting the subject from the in-body [PATCH] line

Merge branch 'js/maint-daemon-syslog' into maintJunio C Hamano Wed, 16 Jul 2008 22:22:05 +0000 (15:22 -0700)

Merge branch 'js/maint-daemon-syslog' into maint

* js/maint-daemon-syslog:
git daemon: avoid calling syslog() from a signal handler

rebase-i: keep old parents when preserving mergesStephan Beyer Wed, 16 Jul 2008 01:51:49 +0000 (03:51 +0200)

rebase-i: keep old parents when preserving merges

When "rebase -i -p" tries to preserve merges of unrelated branches, it
lost some parents:

- When you have more than two parents, the commit in the new history
ends up with fewer than expected number of parents and this breakage
goes unnoticed;

- When you are rebasing a merge with two parents and one is lost, the
command tries to cherry-pick the original merge commit, and the command
fails.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7600-merge: Use test_expect_failure to test option... Johannes Sixt Wed, 16 Jul 2008 08:33:52 +0000 (10:33 +0200)

t7600-merge: Use test_expect_failure to test option parsing

It used plain 'if git merge ...', which hides a segfault. The test does not pass.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix buffer overflow in prepare_attr_stackDmitry Potapov Wed, 16 Jul 2008 15:39:55 +0000 (19:39 +0400)

Fix buffer overflow in prepare_attr_stack

If PATH_MAX on your system is smaller than a path stored in the git repo,
it may cause the buffer overflow in prepare_attr_stack.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix buffer overflow in git diffDmitry Potapov Wed, 16 Jul 2008 14:54:02 +0000 (18:54 +0400)

Fix buffer overflow in git diff

If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>