gitweb.git
reset: avoid redundant error messageMartin von Zweigbergk Tue, 15 Jan 2013 05:47:42 +0000 (21:47 -0800)

reset: avoid redundant error message

If writing or committing the new index file fails, we print "Could not
write new index file." followed by "Could not reset index file to
revision $rev.". The first message seems to imply the second, so print
only the first message.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset --keep: only write index file onceMartin von Zweigbergk Tue, 15 Jan 2013 05:47:41 +0000 (21:47 -0800)

reset --keep: only write index file once

"git reset --keep" calls reset_index_file() twice, first doing a
two-way merge to the target revision, updating the index and worktree,
and then resetting the index. After each call, we write the index
file.

In the unlikely event that the second call to reset_index_file()
fails, the index will have been merged to the target revision, but
HEAD will not be updated, leaving the user with a dirty index.

By moving the locking, writing and committing out of
reset_index_file() and into the caller, we can avoid writing the index
twice, thereby making the sure we don't end up in the half-way reset
state. As a bonus, we speed up "git reset --keep" a little on the
linux-2.6 repo (best of five, warm cache):

Before After
real 0m0.315s 0m0.296s
user 0m0.290s 0m0.280s
sys 0m0.020s 0m0.010s

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset.c: share call to die_if_unmerged_cache()Martin von Zweigbergk Tue, 15 Jan 2013 05:47:40 +0000 (21:47 -0800)

reset.c: share call to die_if_unmerged_cache()

Use a single condition to guard the call to die_if_unmerged_cache for
both --soft and --keep. This avoids the small distraction of the
precondition check from the logic following it.

Also change an instance of

if (e)
err = err || f();

to the almost as short, but clearer

if (e && !err)
err = f();

(which is equivalent since we only care whether exit code is 0)

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset.c: extract function for updating {ORIG_,}HEADMartin von Zweigbergk Tue, 15 Jan 2013 05:47:39 +0000 (21:47 -0800)

reset.c: extract function for updating {ORIG_,}HEAD

By extracting the code for updating the HEAD and ORIG_HEAD symbolic
references to a separate function, we declutter cmd_reset() a bit and
we make it clear that e.g. the four variables {,sha1_}{,old_}orig are
only used by this code.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset.c: remove unnecessary variable 'i'Martin von Zweigbergk Tue, 15 Jan 2013 05:47:38 +0000 (21:47 -0800)

reset.c: remove unnecessary variable 'i'

Throughout most of parse_args(), the variable 'i' remains at 0. Many
references are still made to the variable even when it could only have
the value 0. This made at least me, who has relatively little
experience with C programming styles, think that parts of the function
was meant to be part of a loop. To avoid such confusion, remove the
variable and also the 'argc' parameter and check for NULL trailing
argv instead.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset.c: extract function for parsing argumentsMartin von Zweigbergk Tue, 15 Jan 2013 05:47:37 +0000 (21:47 -0800)

reset.c: extract function for parsing arguments

Declutter cmd_reset() a bit by moving out the argument parsing to its
own function.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset: don't allow "git reset -- $pathspec" in bare... Martin von Zweigbergk Tue, 15 Jan 2013 05:47:36 +0000 (21:47 -0800)

reset: don't allow "git reset -- $pathspec" in bare repo

Running e.g. "git reset ." in a bare repo results in an index file
being created from the HEAD commit. The differences compared to the
index are then printed as usual, but since there is no worktree, it
will appear as if all files are deleted. For example, in a bare clone
of git.git:

Unstaged changes after reset:
D .gitattributes
D .gitignore
D .mailmap
...

This happens because the check for is_bare_repository() happens after
we branch off into read_from_tree() to reset with paths. Fix by moving
the branching point after the check.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset.c: pass pathspec around instead of (prefix, argv... Martin von Zweigbergk Tue, 15 Jan 2013 05:47:35 +0000 (21:47 -0800)

reset.c: pass pathspec around instead of (prefix, argv) pair

We use the path arguments in two places in reset.c: in
interactive_reset() and read_from_tree(). Both of these call
get_pathspec(), so we pass the (prefix, argv) pair to both
functions. Move the call to get_pathspec() out of these methods, for
two reasons: 1) One argument is simpler than two. 2) It lets us use
the (arguably clearer) "if (pathspec)" in place of "if (i < argc)".

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset $pathspec: exit with code 0 if successfulMartin von Zweigbergk Tue, 15 Jan 2013 05:47:34 +0000 (21:47 -0800)

reset $pathspec: exit with code 0 if successful

"git reset $pathspec" currently exits with a non-zero exit code if the
worktree is dirty after resetting, which is inconsistent with reset
without pathspec, and it makes it harder to know whether the command
really failed. Change it to exit with code 0 regardless of whether the
worktree is dirty so that non-zero indicates an error.

This makes the 4 "disambiguation" test cases in t7102 clearer since
they all used to "fail", 3 of which "failed" due to changes in the
work tree. Now only the ambiguous one fails.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset $pathspec: no need to discard indexMartin von Zweigbergk Tue, 15 Jan 2013 05:47:33 +0000 (21:47 -0800)

reset $pathspec: no need to discard index

Since 34110cd (Make 'unpack_trees()' have a separate source and
destination index, 2008-03-06), the index no longer gets clobbered by
do_diff_cache() and we can remove the code for discarding and
re-reading it.

There are two paths to update_index_refresh() from cmd_reset(), but on
both paths, either read_cache() or read_cache_unmerged() will have
been called, so the call to read_cache() in this method is redundant
(although practically free).

This speeds up "git reset -- ." a little on the linux-2.6 repo (best
of five, warm cache):

Before After
real 0m0.093s 0m0.080s
user 0m0.040s 0m0.020s
sys 0m0.050s 0m0.050s

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

attr: fix off-by-one directory component length calculationNguyễn Thái Ngọc Duy Tue, 15 Jan 2013 13:35:24 +0000 (20:35 +0700)

attr: fix off-by-one directory component length calculation

94bc671 (Add directory pattern matching to attributes - 2012-12-08)
uses find_basename() to calculate the length of directory part in
prepare_attr_stack. This function expects the directory without the
trailing slash (as "origin" field in match_attr struct is without the
trailing slash). find_basename() includes the trailing slash and
confuses push/pop algorithm.

Consider path = "abc/def" and the push down code:

while (1) {
len = strlen(attr_stack->origin);
if (dirlen <= len)
break;
cp = memchr(path + len + 1, '/', dirlen - len - 1);
if (!cp)
cp = path + dirlen;

dirlen is 4, not 3, without this patch. So when attr_stack->origin is
"abc", it'll miss the exit condition because 4 <= 3 is wrong. It'll
then try to push "abc/" down the attr stack (because "cp" would be
NULL). So we have both "abc" and "abc/" in the stack.

Next time when "abc/ghi" is checked, "abc/" is popped out because of
the off-by-one dirlen, only to be pushed back in again by the above
code. This repeats for all files in the same directory. Which means
at least one failed open syscall per file, or more if .gitattributes
exists.

This is the perf result with 10 runs on git.git:

Test 94bc671^ 94bc671 HEAD
----------------------------------------------------------------------------------------------------------
7810.1: grep worktree, cheap regex 0.02(0.01+0.04) 0.05(0.03+0.05) +150.0% 0.02(0.01+0.04) +0.0%
7810.2: grep worktree, expensive regex 0.25(0.94+0.01) 0.26(0.94+0.02) +4.0% 0.25(0.93+0.02) +0.0%
7810.3: grep --cached, cheap regex 0.11(0.10+0.00) 0.12(0.10+0.02) +9.1% 0.10(0.10+0.00) -9.1%
7810.4: grep --cached, expensive regex 0.61(0.60+0.01) 0.62(0.61+0.01) +1.6% 0.61(0.60+0.00) +0.0%

Reported-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: use prefixcmp instead of memcmp on NUL-terminat... René Scharfe Mon, 14 Jan 2013 16:34:56 +0000 (17:34 +0100)

pretty: use prefixcmp instead of memcmp on NUL-terminated strings

This conversion avoids the need for magic string length numbers in the
code. And unlike memcmp(), prefixcmp() is careful to not run over the
end of a string.

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

hooks: Add function to check if a hook existsAaron Schrab Sun, 13 Jan 2013 05:17:02 +0000 (00:17 -0500)

hooks: Add function to check if a hook exists

Create find_hook() function to determine if a given hook exists and is
executable. If it is, the path to the script will be returned,
otherwise NULL is returned.

This encapsulates the tests that are used to check for the existence of
a hook in one place, making it easier to modify those checks if that is
found to be necessary. This also makes it simple for places that can
use a hook to check if a hook exists before doing, possibly lengthy,
setup work which would be pointless if no such hook is present.

The returned value is left as a static value from get_pathname() rather
than a duplicate because it is anticipated that the return value will
either be used as a boolean, immediately added to an argv_array list
which would result in it being duplicated at that point, or used to
actually run the command without much intervening work. Callers which
need to hold onto the returned value for a longer time are expected to
duplicate the return value themselves.

Signed-off-by: Aaron Schrab <aaron@schrab.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase --preserve-merges: keep all merge commits includ... Phil Hord Sat, 12 Jan 2013 20:46:01 +0000 (15:46 -0500)

rebase --preserve-merges: keep all merge commits including empty ones

Since 90e1818f9a (git-rebase: add keep_empty flag, 2012-04-20)
'git rebase --preserve-merges' fails to preserve empty merge commits
unless --keep-empty is also specified. Merge commits should be
preserved in order to preserve the structure of the rebased graph,
even if the merge commit does not introduce changes to the parent.

Teach rebase not to drop merge commits only because they are empty.

A special case which is not handled by this change is for a merge commit
whose parents are now the same commit because all the previous different
parents have been dropped as a result of this rebase or some previous
operation.

Signed-off-by: Phil Hord <hordp@cisco.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-clean: Display more accurate delete messagesZoltan Klinger Thu, 10 Jan 2013 22:53:46 +0000 (09:53 +1100)

git-clean: Display more accurate delete messages

(1) Only print out the names of the files and directories that got
actually deleted. Also do not mention that we are not removing
directories when the user did not ask us to do so with '-d'.
(2) Show ignore message for skipped untracked git repositories.

Consider the following repo layout:

test.git/
|-- tracked_dir/
| |-- some_tracked_file
| |-- some_untracked_file
|-- tracked_file
|-- untracked_file
|-- untracked_foo/
| |-- bar/
| | |-- bar.txt
| |-- emptydir/
| |-- frotz.git/
| |-- frotz.tx
|-- untracked_some.git/
|-- some.txt

Suppose the user issues 'git clean -fd' from the test.git directory.

When -d option is used and untracked directory 'foo' contains a
subdirectory 'frotz.git' that is managed by a different git repository
therefore it will not be removed.

$ git clean -fd
Removing tracked_dir/some_untracked_file
Removing untracked_file
Removing untracked_foo/
Removing untracked_some.git/

The message displayed to the user is slightly misleading. The foo/
directory has not been removed because of foo/frotz.git still exists.
On the other hand the subdirectories 'bar' and 'emptydir' have been
deleted but they're not mentioned anywhere. Also, untracked_some.git
has not been removed either.

This behaviour is the result of the way the deletion of untracked
directories are reported. In the current implementation they are
deleted recursively but only the name of the top most directory is
printed out. The calling function does not know about any
subdirectories that could not be removed during the recursion.

Improve the way the deleted directories are reported back to
the user:
(1) Create a recursive delete function 'remove_dirs' in builtin/clean.c
to run in both dry_run and delete modes with the delete logic as
follows:
(a) Check if the current directory to be deleted is an untracked
git repository. If it is and --force --force option is not set
do not touch this directory, print ignore message, set dir_gone
flag to false for the caller and return.
(b) Otherwise for each item in current directory:
(i) If current directory cannot be accessed, print warning,
set dir_gone flag to false and return.
(ii) If the item is a subdirectory recurse into it,
check for the returned value of the dir_gone flag.
If the subdirectory is gone, add the name of the deleted
directory to a list of successfully removed items 'dels'.
Else set the dir_gone flag as the current directory
cannot be removed because we have at least one subdirectory
hanging around.
(iii) If it is a file try to remove it. If success add the
file name to the 'dels' list, else print error and set
dir_gone flag to false.
(c) After we finished deleting all items in the current directory and
the dir_gone flag is still true, remove the directory itself.
If failed set the dir_gone flag to false.

(d) If the current directory cannot be deleted because the dir_gone flag
has been set to false, print out all the successfully deleted items
for this directory from the 'dels' list.
(e) We're done with the current directory, return.

(2) Modify the cmd_clean() function to:
(a) call the recursive delete function 'remove_dirs()' for each
topmost directory it wants to remove
(b) check for the returned value of dir_gone flag. If it's true
print the name of the directory as being removed.

Consider the output of the improved version:

$ git clean -fd
Removing tracked_dir/some_untracked_file
Removing untracked_file
Skipping repository untracked_foo/frotz.git
Removing untracked_foo/bar
Removing untracked_foo/emptydir
Skipping repository untracked_some.git/

Now it displays only the file and directory names that got actually
deleted and shows the name of the untracked git repositories it ignored.

Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Zoltan Klinger <zoltan.klinger@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.8.1.1Junio C Hamano Mon, 14 Jan 2013 16:22:27 +0000 (08:22 -0800)

Sync with 1.8.1.1

Update draft release notes to 1.8.2Junio C Hamano Mon, 14 Jan 2013 16:21:35 +0000 (08:21 -0800)

Update draft release notes to 1.8.2

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

Merge branch 'jc/blame-no-follow'Junio C Hamano Mon, 14 Jan 2013 16:15:51 +0000 (08:15 -0800)

Merge branch 'jc/blame-no-follow'

Teaches "--no-follow" option to "git blame" to disable its
whole-file rename detection.

* jc/blame-no-follow:
blame: pay attention to --no-follow
diff: accept --no-follow option

Merge branch 'fc/remote-testgit-feature-done'Junio C Hamano Mon, 14 Jan 2013 16:15:46 +0000 (08:15 -0800)

Merge branch 'fc/remote-testgit-feature-done'

In the longer term, tightening rules is a good thing to do, and
because nobody who has worked in the remote helper area seems to be
interested in reviewing this, I would assume they do not think
such a retroactive tightening will affect their remote helpers. So
let's advance this topic to see what happens.

* fc/remote-testgit-feature-done:
remote-testgit: properly check for errors

Merge branch 'nd/upload-pack-shallow-must-be-commit'Junio C Hamano Mon, 14 Jan 2013 16:15:44 +0000 (08:15 -0800)

Merge branch 'nd/upload-pack-shallow-must-be-commit'

A minor consistency check patch that does not have much relevance
to the real world.

* nd/upload-pack-shallow-must-be-commit:
upload-pack: only accept commits from "shallow" line

Merge branch 'ap/status-ignored-in-ignored-directory'Junio C Hamano Mon, 14 Jan 2013 16:15:40 +0000 (08:15 -0800)

Merge branch 'ap/status-ignored-in-ignored-directory'

Output from "git status --ignored" showed an unexpected interaction
with "--untracked".

* ap/status-ignored-in-ignored-directory:
status: always report ignored tracked directories
git-status: Test --ignored behavior
dir.c: Make git-status --ignored more consistent

Merge branch 'nz/send-email-headers-are-case-insensitive'Junio C Hamano Mon, 14 Jan 2013 16:15:36 +0000 (08:15 -0800)

Merge branch 'nz/send-email-headers-are-case-insensitive'

When user spells "cc:" in lowercase in the fake "header" in the
trailer part, send-email failed to pick up the addresses from
there. As e-mail headers field names are case insensitive, this
script should follow suit and treat "cc:" and "Cc:" the same way.

* nz/send-email-headers-are-case-insensitive:
git-send-email: treat field names as case-insensitively

Git 1.8.1.1 v1.8.1.1Junio C Hamano Mon, 14 Jan 2013 16:04:50 +0000 (08:04 -0800)

Git 1.8.1.1

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

Merge branch 'jk/complete-commit-c' into maintJunio C Hamano Mon, 14 Jan 2013 16:02:35 +0000 (08:02 -0800)

Merge branch 'jk/complete-commit-c' into maint

* jk/complete-commit-c:
completion: complete refs for "git commit -c"

Merge branch 'jk/unify-exit-code-by-receiving-signal... Junio C Hamano Mon, 14 Jan 2013 16:01:27 +0000 (08:01 -0800)

Merge branch 'jk/unify-exit-code-by-receiving-signal' into maint

* jk/unify-exit-code-by-receiving-signal:
run-command: encode signal death as a positive integer

Merge branch 'jn/xml-depends-on-asciidoc-conf' into... Junio C Hamano Mon, 14 Jan 2013 16:01:00 +0000 (08:01 -0800)

Merge branch 'jn/xml-depends-on-asciidoc-conf' into maint

* jn/xml-depends-on-asciidoc-conf:
docs: manpage XML depends on asciidoc.conf

Merge branch 'jk/maint-fast-import-doc-reorder' into... Junio C Hamano Mon, 14 Jan 2013 15:59:46 +0000 (07:59 -0800)

Merge branch 'jk/maint-fast-import-doc-reorder' into maint

* jk/maint-fast-import-doc-reorder:
git-fast-import(1): reorganise options
git-fast-import(1): combine documentation of --[no-]relative-marks

Merge branch 'jk/shortlog-no-wrap-doc' into maintJunio C Hamano Mon, 14 Jan 2013 15:59:03 +0000 (07:59 -0800)

Merge branch 'jk/shortlog-no-wrap-doc' into maint

* jk/shortlog-no-wrap-doc:
git-shortlog(1): document behaviour of zero-width wrap

Merge branch 'jk/maint-fast-import-doc-dedup-done'... Junio C Hamano Mon, 14 Jan 2013 15:48:39 +0000 (07:48 -0800)

Merge branch 'jk/maint-fast-import-doc-dedup-done' into maint

* jk/maint-fast-import-doc-dedup-done:
git-fast-import(1): remove duplicate '--done' option

Merge branch 'jc/comment-cygwin-win32api-in-makefile... Junio C Hamano Mon, 14 Jan 2013 15:34:37 +0000 (07:34 -0800)

Merge branch 'jc/comment-cygwin-win32api-in-makefile' into maint

* jc/comment-cygwin-win32api-in-makefile:
Makefile: add comment on CYGWIN_V15_WIN32API

Merge branch 'rs/leave-base-name-in-name-field-of-tar... Junio C Hamano Mon, 14 Jan 2013 15:34:12 +0000 (07:34 -0800)

Merge branch 'rs/leave-base-name-in-name-field-of-tar' into maint

A tar archive created by "git archive" recorded a directory in a
way that made NetBSD's implementation of "tar" sometimes unhappy.

* rs/leave-base-name-in-name-field-of-tar:
archive-tar: split long paths more carefully

Merge branch 'jl/interrupt-clone-remove-separate-git... Junio C Hamano Mon, 14 Jan 2013 15:33:48 +0000 (07:33 -0800)

Merge branch 'jl/interrupt-clone-remove-separate-git-dir' into maint

When "git clone --separate-git-dir=$over_there" is interrupted, it
failed to remove the real location of the $GIT_DIR it created. This
was most visible when interrupting a submodule update.

* jl/interrupt-clone-remove-separate-git-dir:
clone: support atomic operation with --separate-git-dir

Merge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credi... Junio C Hamano Mon, 14 Jan 2013 15:33:30 +0000 (07:33 -0800)

Merge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credit' into maint

"git merge --no-edit" computed who were involved in the work done
on the side branch, even though that information is to be discarded
without getting seen in the editor.

* jc/maint-fmt-merge-msg-no-edit-lose-credit:
merge --no-edit: do not credit people involved in the side branch

Merge branch 'jc/apply-trailing-blank-removal' into... Junio C Hamano Mon, 14 Jan 2013 15:33:08 +0000 (07:33 -0800)

Merge branch 'jc/apply-trailing-blank-removal' into maint

"git apply" misbehaved when fixing whitespace breakages by removing
excess trailing blank lines.

* jc/apply-trailing-blank-removal:
apply.c:update_pre_post_images(): the preimage can be truncated

Merge branch 'pf/editor-ignore-sigint' into maintJunio C Hamano Mon, 14 Jan 2013 15:32:25 +0000 (07:32 -0800)

Merge branch 'pf/editor-ignore-sigint' into maint

The behaviour visible to the end users was confusing, when they
attempt to kill a process spawned in the editor that was in turn
launched by Git with SIGINT (or SIGQUIT), as Git would catch that
signal and die. We ignore these signals now.

* pf/editor-ignore-sigint:
fix compilation with NO_PTHREADS
launch_editor: propagate signals from editor to git
run-command: do not warn about child death from terminal
launch_editor: ignore terminal signals while editor has control
launch_editor: refactor to use start/finish_command
run-command: drop silent_exec_failure arg from wait_or_whine

Merge branch 'mk/maint-graph-infinity-loop' into maintJunio C Hamano Mon, 14 Jan 2013 15:32:18 +0000 (07:32 -0800)

Merge branch 'mk/maint-graph-infinity-loop' into maint

* mk/maint-graph-infinity-loop:
graph.c: infinite loop in git whatchanged --graph -m

Makefile: add description on PERL/PYTHON_PATHJunio C Hamano Mon, 14 Jan 2013 06:48:07 +0000 (22:48 -0800)

Makefile: add description on PERL/PYTHON_PATH

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

Update draft release notes to 1.8.2Junio C Hamano Sat, 12 Jan 2013 02:51:09 +0000 (18:51 -0800)

Update draft release notes to 1.8.2

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

Merge branch 'jk/maint-fast-import-doc-reorder'Junio C Hamano Sat, 12 Jan 2013 02:35:07 +0000 (18:35 -0800)

Merge branch 'jk/maint-fast-import-doc-reorder'

* jk/maint-fast-import-doc-reorder:
git-fast-import(1): reorganise options
git-fast-import(1): combine documentation of --[no-]relative-marks

Merge branch 'jk/shortlog-no-wrap-doc'Junio C Hamano Sat, 12 Jan 2013 02:35:01 +0000 (18:35 -0800)

Merge branch 'jk/shortlog-no-wrap-doc'

* jk/shortlog-no-wrap-doc:
git-shortlog(1): document behaviour of zero-width wrap

Merge branch 'rs/zip-with-uncompressed-size-in-the... Junio C Hamano Sat, 12 Jan 2013 02:34:55 +0000 (18:34 -0800)

Merge branch 'rs/zip-with-uncompressed-size-in-the-header'

Improve compatibility of our zip output to fill uncompressed size
in the header, which we can do without seeking back (even though it
should not be necessary).

* rs/zip-with-uncompressed-size-in-the-header:
archive-zip: write uncompressed size into header even with streaming

Merge branch 'rs/zip-tests'Junio C Hamano Sat, 12 Jan 2013 02:34:43 +0000 (18:34 -0800)

Merge branch 'rs/zip-tests'

Update zip tests to skip some that cannot be handled on platform
unzip.

* rs/zip-tests:
t5003: check if unzip supports symlinks
t5000, t5003: move ZIP tests into their own script
t0024, t5000: use test_lazy_prereq for UNZIP
t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead

Merge branch 'jn/xml-depends-on-asciidoc-conf'Junio C Hamano Sat, 12 Jan 2013 02:34:38 +0000 (18:34 -0800)

Merge branch 'jn/xml-depends-on-asciidoc-conf'

* jn/xml-depends-on-asciidoc-conf:
docs: manpage XML depends on asciidoc.conf

Merge branch 'jk/unify-exit-code-by-receiving-signal'Junio C Hamano Sat, 12 Jan 2013 02:34:32 +0000 (18:34 -0800)

Merge branch 'jk/unify-exit-code-by-receiving-signal'

The internal logic had to deal with two representations of a death
of a child process by a signal.

* jk/unify-exit-code-by-receiving-signal:
run-command: encode signal death as a positive integer

Merge branch 'jc/merge-blobs'Junio C Hamano Sat, 12 Jan 2013 02:34:24 +0000 (18:34 -0800)

Merge branch 'jc/merge-blobs'

Update the disused merge-tree proof-of-concept code.

* jc/merge-blobs:
merge-tree: fix d/f conflicts
merge-tree: add comments to clarify what these functions are doing
merge-tree: lose unused "resolve_directories"
merge-tree: lose unused "flags" from merge_list
Which merge_file() function do you mean?

Merge branch 'jc/format-patch-reroll'Junio C Hamano Sat, 12 Jan 2013 02:34:10 +0000 (18:34 -0800)

Merge branch 'jc/format-patch-reroll'

Teach "format-patch" to prefix v4- to its output files for the
fourth iteration of a patch series, to make it easier for the
submitter to keep separate copies for iterations.

* jc/format-patch-reroll:
format-patch: give --reroll-count a short synonym -v
format-patch: document and test --reroll-count
format-patch: add --reroll-count=$N option
get_patch_filename(): split into two functions
get_patch_filename(): drop "just-numbers" hack
get_patch_filename(): simplify function signature
builtin/log.c: stop using global patch_suffix
builtin/log.c: drop redundant "numbered_files" parameter from make_cover_letter()
builtin/log.c: drop unused "numbered" parameter from make_cover_letter()

Merge branch 'maint'Junio C Hamano Sat, 12 Jan 2013 02:33:27 +0000 (18:33 -0800)

Merge branch 'maint'

Merge branch 'as/api-allocation-doc' into maintJunio C Hamano Sat, 12 Jan 2013 00:51:01 +0000 (16:51 -0800)

Merge branch 'as/api-allocation-doc' into maint

* as/api-allocation-doc:
api-allocation-growing.txt: encourage better variable naming

Merge branch 'jk/enable-test-lint-by-default' into... Junio C Hamano Sat, 12 Jan 2013 00:49:37 +0000 (16:49 -0800)

Merge branch 'jk/enable-test-lint-by-default' into maint

We have two simple and quick tests to catch common mistakes when
writing test scripts, but we did not run them by default when
running tests.

* jk/enable-test-lint-by-default:
tests: turn on test-lint by default

Merge branch 'ap/merge-stop-at-prepare-commit-msg-failu... Junio C Hamano Sat, 12 Jan 2013 00:49:01 +0000 (16:49 -0800)

Merge branch 'ap/merge-stop-at-prepare-commit-msg-failure' into maint

"git merge" started calling prepare-commit-msg hook like "git
commit" does some time ago, but forgot to pay attention to the exit
status of the hook.

* ap/merge-stop-at-prepare-commit-msg-failure:
merge: Honor prepare-commit-msg return code

Merge branch 'jc/submittingpatches' into maintJunio C Hamano Sat, 12 Jan 2013 00:48:54 +0000 (16:48 -0800)

Merge branch 'jc/submittingpatches' into maint

* jc/submittingpatches:
SubmittingPatches: give list and maintainer addresses
SubmittingPatches: remove overlong checklist
SubmittingPatches: mention subsystems with dedicated repositories
SubmittingPatches: who am I and who cares?

Merge branch 'os/gitweb-highlight-uncaptured' into... Junio C Hamano Sat, 12 Jan 2013 00:48:30 +0000 (16:48 -0800)

Merge branch 'os/gitweb-highlight-uncaptured' into maint

"gitweb", when sorting by age to show repositories with new
activities first, used to sort repositories with absolutely nothing
in it early, which was not very useful.

* os/gitweb-highlight-uncaptured:
gitweb: fix error in sanitize when highlight is enabled

Merge branch 'jn/less-reconfigure' into maintJunio C Hamano Sat, 12 Jan 2013 00:48:03 +0000 (16:48 -0800)

Merge branch 'jn/less-reconfigure' into maint

When autoconf is used, any build on a different commit always ran
"config.status --recheck" even when unnecessary.

* jn/less-reconfigure:
build: do not automatically reconfigure unless configure.ac changed

Merge branch 'kb/maint-bundle-doc' into maintJunio C Hamano Sat, 12 Jan 2013 00:47:56 +0000 (16:47 -0800)

Merge branch 'kb/maint-bundle-doc' into maint

* kb/maint-bundle-doc:
Documentation: full-ness of a bundle is significant for cloning
Documentation: correct example restore from bundle

Merge branch 'as/test-name-alias-uniquely' into maintJunio C Hamano Sat, 12 Jan 2013 00:47:34 +0000 (16:47 -0800)

Merge branch 'as/test-name-alias-uniquely' into maint

* as/test-name-alias-uniquely:
Use longer alias names in subdirectory tests

Merge branch 'jn/warn-on-inaccessible-loosen' into... Junio C Hamano Sat, 12 Jan 2013 00:47:07 +0000 (16:47 -0800)

Merge branch 'jn/warn-on-inaccessible-loosen' into maint

When attempting to read the XDG-style $HOME/.config/git/config and
finding that $HOME/.config/git is a file, we gave a wrong error
message, instead of treating the case as "a custom config file does
not exist there" and moving on.

* jn/warn-on-inaccessible-loosen:
config: exit on error accessing any config file
doc: advertise GIT_CONFIG_NOSYSTEM
config: treat user and xdg config permission problems as errors
config, gitignore: failure to access with ENOTDIR is ok

Merge branch 'ja/directory-attrs' into maintJunio C Hamano Sat, 12 Jan 2013 00:46:46 +0000 (16:46 -0800)

Merge branch 'ja/directory-attrs' into maint

The attribute mechanism didn't allow limiting attributes to be
applied to only a single directory itself with "path/" like the
exclude mechanism does.

* ja/directory-attrs:
Add directory pattern matching to attributes

Merge branch 'jc/fetch-ignore-symref' into maintJunio C Hamano Sat, 12 Jan 2013 00:45:44 +0000 (16:45 -0800)

Merge branch 'jc/fetch-ignore-symref' into maint

"git fetch --mirror" and fetch that uses other forms of refspec with
wildcard used to attempt to update a symbolic ref that match the
wildcard on the receiving end, which made little sense (the real ref
that is pointed at by the symbolic ref would be updated anyway).

Symbolic refs no longer are affected by such a fetch.

* jc/fetch-ignore-symref:
fetch: ignore wildcarded refspecs that update local symbolic refs

Merge branch 'ss/svn-prompt' into maintJunio C Hamano Sat, 12 Jan 2013 00:45:06 +0000 (16:45 -0800)

Merge branch 'ss/svn-prompt' into maint

The way "git svn" asked for password using SSH_ASKPASS and
GIT_ASKPASS was not in line with the rest of the system.

* ss/svn-prompt:
git-svn, perl/Git.pm: extend and use Git->prompt method for querying users
perl/Git.pm: Honor SSH_ASKPASS as fallback if GIT_ASKPASS is not set
git-svn, perl/Git.pm: add central method for prompting passwords

git-completion.bash: silence "not a valid object" errorsDylan Smith Fri, 11 Jan 2013 08:06:22 +0000 (03:06 -0500)

git-completion.bash: silence "not a valid object" errors

Trying to complete the command

git show master:./file

would cause a "Not a valid object name" error to be output on standard
error. Silence the error so it won't appear on the command line.

Signed-off-by: Dylan Smith <dylan.ah.smith@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: forbid --bare --separate-git-dir <dir>Nguyễn Thái Ngọc Duy Fri, 11 Jan 2013 03:09:59 +0000 (10:09 +0700)

clone: forbid --bare --separate-git-dir <dir>

The --separate-git-dir option was introduced to make it simple to put
the git directory somewhere outside the worktree, for example when
cloning a repository for use as a submodule.

It was not intended for use when creating a bare repository. In that
case there is no worktree and it is more natural to directly clone the
repository and create a .git file as separate steps:

git clone --bare /path/to/repo.git bar.git
printf 'gitdir: bar.git\n' >foo.git

Forbid the combination, making the command easier to explain.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/vim: simplify instructions for old vim supportJonathan Nieder Thu, 10 Jan 2013 20:54:27 +0000 (12:54 -0800)

contrib/vim: simplify instructions for old vim support

Rely on the upstream filetype.vim instead of duplicating its rules in
git's instructions for syntax highlighting support on pre-7.2 vim
versions.

The result is a shorter contrib/vim/README. More importantly, it lets
us punt on maintenance of the autocmd rules.

So now when we fix the upstream gitsendemail rule in light of commit
eed6ca7, new git users stuck on old vim reading contrib/vim/README can
automagically get the fix without any further changes needed to git.

Once the world has moved on to vim 7.2+ completely, we can get rid of
these instructions, but for now if they are this simple it's
effortless to keep them.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0008: avoid brace expansionRené Scharfe Thu, 10 Jan 2013 21:24:52 +0000 (22:24 +0100)

t0008: avoid brace expansion

Brace expansion is a shell feature that's not required by POSIX and not
supported by dash nor NetBSD's sh. Explicitly list all combinations
instead. Also avoid calling touch by creating the test files with a
redirection instead, as suggested by Junio.

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

Merge branch 'maint'Junio C Hamano Thu, 10 Jan 2013 22:38:00 +0000 (14:38 -0800)

Merge branch 'maint'

* maint:
Prepare for 1.8.1.1
Makefile: detect when PYTHON_PATH changes (cherry-picked)

Update draft release notes to 1.8.2Junio C Hamano Thu, 10 Jan 2013 22:36:23 +0000 (14:36 -0800)

Update draft release notes to 1.8.2

Prepare for 1.8.1.1Junio C Hamano Thu, 10 Jan 2013 22:17:13 +0000 (14:17 -0800)

Prepare for 1.8.1.1

Makefile: detect when PYTHON_PATH changesChristian Couder Tue, 18 Dec 2012 15:26:38 +0000 (16:26 +0100)

Makefile: detect when PYTHON_PATH changes

When make is run, the python scripts are created from *.py files that
are changed to use the python given by PYTHON_PATH. And PYTHON_PATH
is set by default to /usr/bin/python on Linux.

However, next time make is run with a different value in PYTHON_PATH,
we failed to regenerate these scripts.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ta/remove-stale-translated-tut' into... Junio C Hamano Thu, 10 Jan 2013 22:11:18 +0000 (14:11 -0800)

Merge branch 'ta/remove-stale-translated-tut' into maint

* ta/remove-stale-translated-tut:
Remove Documentation/pt_BR/gittutorial.txt

Merge branch 'tb/test-t9810-no-sed-i' into maintJunio C Hamano Thu, 10 Jan 2013 22:10:40 +0000 (14:10 -0800)

Merge branch 'tb/test-t9810-no-sed-i' into maint

* tb/test-t9810-no-sed-i:
t9810: Do not use sed -i

Merge branch 'tb/test-t9020-no-which' into maintJunio C Hamano Thu, 10 Jan 2013 22:10:36 +0000 (14:10 -0800)

Merge branch 'tb/test-t9020-no-which' into maint

* tb/test-t9020-no-which:
t9020: which is not portable

Merge branch 'mh/pthreads-autoconf' into maintJunio C Hamano Thu, 10 Jan 2013 22:04:26 +0000 (14:04 -0800)

Merge branch 'mh/pthreads-autoconf' into maint

* mh/pthreads-autoconf:
configure.ac: fix pthreads detection on Mac OS X

Merge branch 'jc/same-encoding' into maintJunio C Hamano Thu, 10 Jan 2013 22:04:24 +0000 (14:04 -0800)

Merge branch 'jc/same-encoding' into maint

* jc/same-encoding:
format_commit_message(): simplify calls to logmsg_reencode()

Merge branch 'sp/shortlog-missing-lf' into maintJunio C Hamano Thu, 10 Jan 2013 22:04:22 +0000 (14:04 -0800)

Merge branch 'sp/shortlog-missing-lf' into maint

* sp/shortlog-missing-lf:
strbuf_add_wrapped*(): Remove unused return value
shortlog: fix wrapping lines of wraplen

Merge branch 'md/gitweb-sort-by-age' into maintJunio C Hamano Thu, 10 Jan 2013 22:04:21 +0000 (14:04 -0800)

Merge branch 'md/gitweb-sort-by-age' into maint

* md/gitweb-sort-by-age:
gitweb: Sort projects with undefined ages last

Merge branch 'nd/invalidate-i-t-a-cache-tree' into... Junio C Hamano Thu, 10 Jan 2013 22:04:19 +0000 (14:04 -0800)

Merge branch 'nd/invalidate-i-t-a-cache-tree' into maint

* nd/invalidate-i-t-a-cache-tree:
cache-tree: invalidate i-t-a paths after generating trees
cache-tree: fix writing cache-tree when CE_REMOVE is present
cache-tree: replace "for" loops in update_one with "while" loops
cache-tree: remove dead i-t-a code in verify_cache()

Merge branch 'jk/repack-ref-racefix' into maintJunio C Hamano Thu, 10 Jan 2013 22:04:17 +0000 (14:04 -0800)

Merge branch 'jk/repack-ref-racefix' into maint

* jk/repack-ref-racefix:
refs: do not use cached refs in repack_without_ref

Merge branch 'rb/http-cert-cred-no-username-prompt... Junio C Hamano Thu, 10 Jan 2013 22:03:54 +0000 (14:03 -0800)

Merge branch 'rb/http-cert-cred-no-username-prompt' into maint

* rb/http-cert-cred-no-username-prompt:
http.c: Avoid username prompt for certifcate credentials

Merge branch 'jc/comment-cygwin-win32api-in-makefile'Junio C Hamano Thu, 10 Jan 2013 21:47:43 +0000 (13:47 -0800)

Merge branch 'jc/comment-cygwin-win32api-in-makefile'

* jc/comment-cygwin-win32api-in-makefile:
Makefile: add comment on CYGWIN_V15_WIN32API

Merge branch 'as/api-allocation-doc'Junio C Hamano Thu, 10 Jan 2013 21:47:40 +0000 (13:47 -0800)

Merge branch 'as/api-allocation-doc'

* as/api-allocation-doc:
api-allocation-growing.txt: encourage better variable naming

Merge branch 'rs/leave-base-name-in-name-field-of-tar'Junio C Hamano Thu, 10 Jan 2013 21:47:35 +0000 (13:47 -0800)

Merge branch 'rs/leave-base-name-in-name-field-of-tar'

Improve compatibility with implementations of "tar" that do not
like empty name field in header (with the additional prefix field
holding everything).

* rs/leave-base-name-in-name-field-of-tar:
archive-tar: split long paths more carefully

Merge branch 'jl/interrupt-clone-remove-separate-git... Junio C Hamano Thu, 10 Jan 2013 21:47:30 +0000 (13:47 -0800)

Merge branch 'jl/interrupt-clone-remove-separate-git-dir'

When "git clone --separate-git-dir" is interrupted, we failed to
remove the real location we created the repository.

* jl/interrupt-clone-remove-separate-git-dir:
clone: support atomic operation with --separate-git-dir

Merge branch 'as/dir-c-cleanup'Junio C Hamano Thu, 10 Jan 2013 21:47:25 +0000 (13:47 -0800)

Merge branch 'as/dir-c-cleanup'

Refactor and generally clean up the directory traversal API
implementation.

* as/dir-c-cleanup:
dir.c: rename free_excludes() to clear_exclude_list()
dir.c: refactor is_path_excluded()
dir.c: refactor is_excluded()
dir.c: refactor is_excluded_from_list()
dir.c: rename excluded() to is_excluded()
dir.c: rename excluded_from_list() to is_excluded_from_list()
dir.c: rename path_excluded() to is_path_excluded()
dir.c: rename cryptic 'which' variable to more consistent name
Improve documentation and comments regarding directory traversal API
api-directory-listing.txt: update to match code

Merge branch 'jk/config-uname'Junio C Hamano Thu, 10 Jan 2013 21:47:20 +0000 (13:47 -0800)

Merge branch 'jk/config-uname'

Move the bits to set fallback default based on the platform from
the main Makefile to a separate file, so that it can be included in
Makefiles in subdirectories.

* jk/config-uname:
Makefile: hoist uname autodetection to config.mak.uname

Merge branch 'nd/wildmatch'Junio C Hamano Thu, 10 Jan 2013 21:47:15 +0000 (13:47 -0800)

Merge branch 'nd/wildmatch'

Allows pathname patterns in .gitignore and .gitattributes files
with double-asterisks "foo/**/bar" to match any number of directory
hierarchies.

* nd/wildmatch:
wildmatch: replace variable 'special' with better named ones
compat/fnmatch: respect NO_FNMATCH* even on glibc
wildmatch: fix "**" special case
t3070: Disable some failing fnmatch tests
test-wildmatch: avoid Windows path mangling
Support "**" wildcard in .gitignore and .gitattributes
wildmatch: make /**/ match zero or more directories
wildmatch: adjust "**" behavior
wildmatch: fix case-insensitive matching
wildmatch: remove static variable force_lower_case
wildmatch: make wildmatch's return value compatible with fnmatch
t3070: disable unreliable fnmatch tests
Integrate wildmatch to git
wildmatch: follow Git's coding convention
wildmatch: remove unnecessary functions
Import wildmatch from rsync
ctype: support iscntrl, ispunct, isxdigit and isprint
ctype: make sane_ctype[] const array

Conflicts:
Makefile

Merge branch 'tb/test-shell-lint'Junio C Hamano Thu, 10 Jan 2013 21:47:04 +0000 (13:47 -0800)

Merge branch 'tb/test-shell-lint'

Check for common mistakes in the test scripts, based on simple
pattern-matching.

* tb/test-shell-lint:
test: Add check-non-portable-shell.pl

Merge branch 'mz/pick-unborn'Junio C Hamano Thu, 10 Jan 2013 21:46:51 +0000 (13:46 -0800)

Merge branch 'mz/pick-unborn'

Allow "git cherry-pick $commit" even when you do not have any
history behind HEAD yet.

* mz/pick-unborn:
learn to pick/revert into unborn branch
tests: move test_cmp_rev to test-lib-functions

Merge branch 'aw/rebase-am-failure-detection'Junio C Hamano Thu, 10 Jan 2013 21:46:46 +0000 (13:46 -0800)

Merge branch 'aw/rebase-am-failure-detection'

Save output from format-patch command in a temporary file, just in
case it aborts, to give a better failure-case behaviour.

* aw/rebase-am-failure-detection:
rebase: Handle cases where format-patch fails

Merge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credit'Junio C Hamano Thu, 10 Jan 2013 21:46:29 +0000 (13:46 -0800)

Merge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credit'

Stop spending cycles to compute information to be placed on
commented lines in "merge --no-edit", which will be discarded
anyway.

* jc/maint-fmt-merge-msg-no-edit-lose-credit:
merge --no-edit: do not credit people involved in the side branch

log --use-mailmap: optimize for cases without --author... Junio C Hamano Tue, 8 Jan 2013 08:02:49 +0000 (00:02 -0800)

log --use-mailmap: optimize for cases without --author/--committer search

When we taught the commit_match() mechanism to pay attention to the
new --use-mailmap option, we started to unconditionally copy the
commit object to a temporary buffer, just in case we need the author
and committer lines updated via the mailmap mechanism, and rewrite
author and committer using the mailmap.

It turns out that this has a rather unpleasant performance
implications. In the linux kernel repository, running

$ git log --author='Junio C Hamano' --pretty=short >/dev/null

under /usr/bin/time, with and without --use-mailmap (the .mailmap
file is 118 entries long, the particular author does not appear in
it), cost (with warm cache):

[without --use-mailmap]
5.42user 0.26system 0:05.70elapsed 99%CPU (0avgtext+0avgdata 2005936maxresident)k
0inputs+0outputs (0major+137669minor)pagefaults 0swaps

[with --use-mailmap]
6.47user 0.30system 0:06.78elapsed 99%CPU (0avgtext+0avgdata 2006288maxresident)k
0inputs+0outputs (0major+137692minor)pagefaults 0swaps

which incurs about 20% overhead. The command is doing extra work,
so the extra cost may be justified.

But it is inexcusable to pay the cost when we do not need
author/committer match. In the same repository,

$ git log --grep='fix menuconfig on debian lenny' --pretty=short >/dev/null

shows very similar numbers as the above:

[without --use-mailmap]
5.32user 0.30system 0:05.63elapsed 99%CPU (0avgtext+0avgdata 2005984maxresident)k
0inputs+0outputs (0major+137672minor)pagefaults 0swaps

[with --use-mailmap]
6.64user 0.24system 0:06.89elapsed 99%CPU (0avgtext+0avgdata 2006320maxresident)k
0inputs+0outputs (0major+137694minor)pagefaults 0swaps

The latter case is an unnecessary performance regression. We may
want to _show_ the result with mailmap applied, but we do not have
to copy and rewrite the author/committer of all commits we try to
match if we do not query for these fields.

Trivially optimize this performace regression by limiting the
rewrites for only when we are matching with author/committer fields.

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

log: add log.mailmap configuration optionAntoine Pelisse Sat, 5 Jan 2013 21:26:46 +0000 (22:26 +0100)

log: add log.mailmap configuration option

Teach "log.mailmap" configuration variable to turn "--use-mailmap"
option on to "git log", "git show" and "git whatchanged".

The "--no-use-mailmap" option from the command line can countermand
the setting.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: grep author/committer using mailmapAntoine Pelisse Sat, 5 Jan 2013 21:26:45 +0000 (22:26 +0100)

log: grep author/committer using mailmap

Currently you can use mailmap to display log authors and committers
but you can't use the mailmap to find commits with mapped values.

This commit allows you to run:

git log --use-mailmap --author mapped_name_or_email
git log --use-mailmap --committer mapped_name_or_email

Of course it only works if the --use-mailmap option is used.

The new name and email are copied only when necessary.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: add test for --use-mailmap optionAntoine Pelisse Sat, 5 Jan 2013 21:26:44 +0000 (22:26 +0100)

test: add test for --use-mailmap option

The new option '--use-mailmap' can be used to make sure that mailmap
file is used to convert name when running log commands.

The test is simple and checks that the Author line
is correctly replaced when running log.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: add --use-mailmap optionAntoine Pelisse Sat, 5 Jan 2013 21:26:43 +0000 (22:26 +0100)

log: add --use-mailmap option

Add the --use-mailmap option to log commands. It allows to display
names from mailmap file when displaying logs, whatever the format
used.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: use mailmap to display username and emailAntoine Pelisse Sat, 5 Jan 2013 21:26:42 +0000 (22:26 +0100)

pretty: use mailmap to display username and email

Use the mailmap information to display the rewritten
username and email address in all log commands.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailmap: add mailmap structure to rev_info and ppAntoine Pelisse Sat, 5 Jan 2013 21:26:41 +0000 (22:26 +0100)

mailmap: add mailmap structure to rev_info and pp

Pass a mailmap from rev_info to pretty_print_context to so that the
pretty printer can use rewritten name and email address when showing
commits.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailmap: simplify map_user() interfaceAntoine Pelisse Sat, 5 Jan 2013 21:26:40 +0000 (22:26 +0100)

mailmap: simplify map_user() interface

Simplify map_user(), mostly to avoid copies of string buffers. It
also simplifies caller functions.

map_user() directly receive pointers and length from the commit buffer
as mail and name. If mapping of the user and mail can be done, the
pointer is updated to a new location. Lengths are also updated if
necessary.

The caller of map_user() can then copy the new email and name if
necessary.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailmap: remove email copy and length limitationJunio C Hamano Sat, 5 Jan 2013 21:26:39 +0000 (22:26 +0100)

mailmap: remove email copy and length limitation

In map_user(), we have email pointer that points at the beginning of
an e-mail address, but the buffer is not terminated with a NUL after
the e-mail address. It typically has ">" after the address, and it
could have even more if it comes from author/committer line in a
commit object. Or it may not have ">" after it.

We used to copy the e-mail address proper into a temporary buffer
before asking the string-list API to find the e-mail address in the
mailmap, because string_list_lookup() function only takes a NUL
terminated full string.

Introduce a helper function lookup_prefix that takes the email
pointer and the length, and finds a matching entry in the string
list used for the mailmap, by doing the following:

- First ask string_list_find_insert_index() where in its sorted
list the e-mail address we have (including the possible trailing
junk ">...") would be inserted.

- It could find an exact match (e.g. we had a clean e-mail address
without any trailing junk). We can return the item in that case.

- Or it could return the index of an item that sorts after the
e-mail address we have.

- If we did not find an exact match against a clean e-mail address,
then the record we are looking for in the mailmap has to exist
before the index returned by the function (i.e. "email>junk"
always sorts later than "email"). Iterate, starting from that
index, down the map->items[] array until we find the exact record
we are looking for, or we see a record with a key that definitely
sorts earlier than the e-mail we are looking for (i.e. when we
are looking for "email" in "email>junk", a record in the mailmap
that begins with "emaik" strictly sorts before "email", if such a
key existed in the mailmap).

This, together with the earlier enhancement to support
case-insensitive sorting, allow us to remove an extra copy of email
buffer to downcase it.

A part of this is based on Antoine Pelisse's previous work.

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

commit: make default of "cleanup" option configurableRalf Thielow Thu, 10 Jan 2013 17:45:59 +0000 (18:45 +0100)

commit: make default of "cleanup" option configurable

The default of the "cleanup" option in "git commit"
is not configurable. Users who don't want to use the
default have to pass this option on every commit since
there's no way to configure it. This commit introduces
a new config option "commit.cleanup" which can be used
to change the default of the "cleanup" option in
"git commit".

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-commit-tree(1): correct description of defaultsPeter Eisentraut Thu, 10 Jan 2013 12:29:58 +0000 (07:29 -0500)

git-commit-tree(1): correct description of defaults

The old phrasing indicated that the EMAIL environment variable takes
precedence over the user.email configuration setting, but it is the
other way around.

Signed-off-by: Peter Eisentraut <peter@eisentraut.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-fast-import(1): reorganise optionsJohn Keeping Wed, 9 Jan 2013 19:45:29 +0000 (19:45 +0000)

git-fast-import(1): reorganise options

The options in git-fast-import(1) are not currently arranged in a
logical order, which has caused the '--done' options to be documented
twice (commit 3266de10).

Rearrange them into logical groups under subheadings.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>