gitweb.git
Merge branch 'jc/core-checkstat-2.0'Junio C Hamano Fri, 7 Mar 2014 23:16:22 +0000 (15:16 -0800)

Merge branch 'jc/core-checkstat-2.0'

"core.statinfo" configuration variable, which was a never-advertised
synonym to "core.checkstat", has been removed.

Merge branch 'jc/add-2.0-ignore-removal'Junio C Hamano Fri, 7 Mar 2014 23:14:47 +0000 (15:14 -0800)

Merge branch 'jc/add-2.0-ignore-removal'

"git add <pathspec>" is the same as "git add -A <pathspec>" now,
i.e. it does not ignore removals from the directory specified.

Merge branch 'jn/add-2.0-u-A-sans-pathspec'Junio C Hamano Fri, 7 Mar 2014 23:14:01 +0000 (15:14 -0800)

Merge branch 'jn/add-2.0-u-A-sans-pathspec'

"git add -u" and "git add -A" without any pathspec is a tree-wide
operation now, even when they are run in a subdirectory of the
working tree.

Merge branch 'jc/push-2.0-default-to-simple'Junio C Hamano Fri, 7 Mar 2014 23:13:15 +0000 (15:13 -0800)

Merge branch 'jc/push-2.0-default-to-simple'

Finally update the "git push" default behaviour to "simple".

Merge branch 'maint'Junio C Hamano Wed, 5 Mar 2014 23:06:59 +0000 (15:06 -0800)

Merge branch 'maint'

* maint:
i18n: proposed command missing leading dash

Merge branch 'jk/run-network-tests-by-default'Junio C Hamano Wed, 5 Mar 2014 23:06:42 +0000 (15:06 -0800)

Merge branch 'jk/run-network-tests-by-default'

Teach "make test" to run networking tests when possible by default.

* jk/run-network-tests-by-default:
tests: turn on network daemon tests by default

Merge branch 'nd/daemonize-gc'Junio C Hamano Wed, 5 Mar 2014 23:06:38 +0000 (15:06 -0800)

Merge branch 'nd/daemonize-gc'

Allow running "gc --auto" in the background.

* nd/daemonize-gc:
gc: config option for running --auto in background
daemon: move daemonize() to libgit.a

Merge branch 'ks/combine-diff'Junio C Hamano Wed, 5 Mar 2014 23:06:26 +0000 (15:06 -0800)

Merge branch 'ks/combine-diff'

Teach combine-diff to honour the path-output-order imposed by
diffcore-order, and optimize how matching paths are found in
the N-way diffs made with parents.

* ks/combine-diff:
tests: add checking that combine-diff emits only correct paths
combine-diff: simplify intersect_paths() further
combine-diff: combine_diff_path.len is not needed anymore
combine-diff: optimize combine_diff_path sets intersection
diff test: add tests for combine-diff with orderfile
diffcore-order: export generic ordering interface

i18n: proposed command missing leading dashSandy Carter Mon, 3 Mar 2014 14:55:53 +0000 (09:55 -0500)

i18n: proposed command missing leading dash

Add missing leading dash to proposed commands in french output when
using the command:
git branch --set-upstream remotename/branchname
and when upstream is gone

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'nd/http-fetch-shallow-fix'Junio C Hamano Thu, 27 Feb 2014 22:01:50 +0000 (14:01 -0800)

Merge branch 'nd/http-fetch-shallow-fix'

Attempting to deepen a shallow repository by fetching over smart
HTTP transport failed in the protocol exchange, when no-done
extension was used. The fetching side waited for the list of
shallow boundary commits after the sending end stopped talking to
it.

* nd/http-fetch-shallow-fix:
t5537: move http tests out to t5539
fetch-pack: fix deepen shallow over smart http with no-done cap
protocol-capabilities.txt: document no-done
protocol-capabilities.txt: refer multi_ack_detailed back to pack-protocol.txt
pack-protocol.txt: clarify 'obj-id' in the last ACK after 'done'
test: rename http fetch and push test files

Merge branch 'jk/pack-bitmap'Junio C Hamano Thu, 27 Feb 2014 22:01:48 +0000 (14:01 -0800)

Merge branch 'jk/pack-bitmap'

Borrow the bitmap index into packfiles from JGit to speed up
enumeration of objects involved in a commit range without having to
fully traverse the history.

* jk/pack-bitmap: (26 commits)
ewah: unconditionally ntohll ewah data
ewah: support platforms that require aligned reads
read-cache: use get_be32 instead of hand-rolled ntoh_l
block-sha1: factor out get_be and put_be wrappers
do not discard revindex when re-preparing packfiles
pack-bitmap: implement optional name_hash cache
t/perf: add tests for pack bitmaps
t: add basic bitmap functionality tests
count-objects: recognize .bitmap in garbage-checking
repack: consider bitmaps when performing repacks
repack: handle optional files created by pack-objects
repack: turn exts array into array-of-struct
repack: stop using magic number for ARRAY_SIZE(exts)
pack-objects: implement bitmap writing
rev-list: add bitmap mode to speed up object lists
pack-objects: use bitmaps when packing objects
pack-objects: split add_object_entry
pack-bitmap: add support for bitmap indexes
documentation: add documentation for the bitmap format
ewah: compressed bitmap implementation
...

Merge branch 'dk/blame-janitorial'Junio C Hamano Thu, 27 Feb 2014 22:01:46 +0000 (14:01 -0800)

Merge branch 'dk/blame-janitorial'

Code clean-up.

* dk/blame-janitorial:
builtin/blame.c::find_copy_in_blob: no need to scan for region end
blame.c: prepare_lines should not call xrealloc for every line
builtin/blame.c::prepare_lines: fix allocation size of sb->lineno
builtin/blame.c: eliminate same_suspect()
builtin/blame.c: struct blame_entry does not need a prev link

Merge branch 'bc/gpg-sign-everywhere'Junio C Hamano Thu, 27 Feb 2014 22:01:44 +0000 (14:01 -0800)

Merge branch 'bc/gpg-sign-everywhere'

Teach "--gpg-sign" option to many commands that create commits.

* bc/gpg-sign-everywhere:
pull: add the --gpg-sign option.
rebase: add the --gpg-sign option
rebase: parse options in stuck-long mode
rebase: don't try to match -M option
rebase: remove useless arguments check
am: add the --gpg-sign option
am: parse options in stuck-long mode
git-sh-setup.sh: add variable to use the stuck-long mode
cherry-pick, revert: add the --gpg-sign option

Merge branch 'al/docs'Junio C Hamano Thu, 27 Feb 2014 22:01:43 +0000 (14:01 -0800)

Merge branch 'al/docs'

A handful of documentation updates, all trivially harmless.

* al/docs:
docs/git-blame: explain more clearly the example pickaxe use
docs/git-clone: clarify use of --no-hardlinks option
docs/git-remote: capitalize first word of initial blurb
docs/merge-strategies: remove hyphen from mis-merges

Merge branch 'jk/test-ports'Junio C Hamano Thu, 27 Feb 2014 22:01:42 +0000 (14:01 -0800)

Merge branch 'jk/test-ports'

Avoid having to assign port number to be used in tests manually.

* jk/test-ports:
tests: auto-set git-daemon port
tests: auto-set LIB_HTTPD_PORT from test name

Merge branch 'nd/reset-intent-to-add'Junio C Hamano Thu, 27 Feb 2014 22:01:40 +0000 (14:01 -0800)

Merge branch 'nd/reset-intent-to-add'

* nd/reset-intent-to-add:
reset: support "--mixed --intent-to-add" mode

Merge branch 'ks/tree-diff-walk'Junio C Hamano Thu, 27 Feb 2014 22:01:38 +0000 (14:01 -0800)

Merge branch 'ks/tree-diff-walk'

* ks/tree-diff-walk:
tree-walk: finally switch over tree descriptors to contain a pre-parsed entry
revision: convert to using diff_tree_sha1()
line-log: convert to using diff_tree_sha1()
tree-diff: convert diff_root_tree_sha1() to just call diff_tree_sha1 with old=NULL
tree-diff: allow diff_tree_sha1 to accept NULL sha1

Merge branch 'mw/symlinks'Junio C Hamano Thu, 27 Feb 2014 22:01:37 +0000 (14:01 -0800)

Merge branch 'mw/symlinks'

All subcommands that take pathspecs mishandled an in-tree symbolic
link when given it as a full path from the root (which arguably is
a sick way to use pathspecs). "git ls-files -s $(pwd)/RelNotes" in
our tree is an easy reproduction recipe.

* mw/symlinks:
setup: don't dereference in-tree symlinks for absolute paths
setup: add abspath_part_inside_repo() function
t0060: add tests for prefix_path when path begins with work tree
t0060: add test for prefix_path when path == work tree
t0060: add test for prefix_path on symlinks via absolute paths
t3004: add test for ls-files on symlinks via absolute paths

Merge branch 'nd/test-rename-reset'Junio C Hamano Thu, 27 Feb 2014 22:01:35 +0000 (14:01 -0800)

Merge branch 'nd/test-rename-reset'

* nd/test-rename-reset:
t7101, t7014: rename test files to indicate what that file is for

Merge branch 'wk/submodule-on-branch'Junio C Hamano Thu, 27 Feb 2014 22:01:31 +0000 (14:01 -0800)

Merge branch 'wk/submodule-on-branch'

Make sure 'submodule update' modes that do not detach HEADs can
be used more pleasantly by checking out a concrete branch when
cloning them to prime the well.

* wk/submodule-on-branch:
Documentation: describe 'submodule update --remote' use case
submodule: explicit local branch creation in module_clone
submodule: document module_clone arguments in comments
submodule: make 'checkout' update_module mode more explicit

Merge branch 'ep/varscope'Junio C Hamano Thu, 27 Feb 2014 22:01:30 +0000 (14:01 -0800)

Merge branch 'ep/varscope'

Shrink lifetime of variables by moving their definitions to an
inner scope where appropriate.

* ep/varscope:
builtin/gc.c: reduce scope of variables
builtin/fetch.c: reduce scope of variable
builtin/commit.c: reduce scope of variables
builtin/clean.c: reduce scope of variable
builtin/blame.c: reduce scope of variables
builtin/apply.c: reduce scope of variables
bisect.c: reduce scope of variable

Merge branch 'bs/stdio-undef-before-redef'Junio C Hamano Thu, 27 Feb 2014 22:01:28 +0000 (14:01 -0800)

Merge branch 'bs/stdio-undef-before-redef'

When we replace broken macros from stdio.h in git-compat-util.h,
preprocessor.

* bs/stdio-undef-before-redef:
git-compat-util.h: #undef (v)snprintf before #define them

Merge branch 'jk/config-path-include-fix'Junio C Hamano Thu, 27 Feb 2014 22:01:25 +0000 (14:01 -0800)

Merge branch 'jk/config-path-include-fix'

include.path variable (or any variable that expects a path that can
use ~username expansion) in the configuration file is not a
boolean, but the code failed to check it.

* jk/config-path-include-fix:
handle_path_include: don't look at NULL value
expand_user_path: do not look at NULL path

Merge branch 'ds/rev-parse-required-args'Junio C Hamano Thu, 27 Feb 2014 22:01:23 +0000 (14:01 -0800)

Merge branch 'ds/rev-parse-required-args'

"git rev-parse --default" without the required option argument did
not diagnose it as an error.

* ds/rev-parse-required-args:
rev-parse: check i before using argv[i] against argc

Merge branch 'nd/diff-quiet-stat-dirty'Junio C Hamano Thu, 27 Feb 2014 22:01:21 +0000 (14:01 -0800)

Merge branch 'nd/diff-quiet-stat-dirty'

"git diff --quiet -- pathspec1 pathspec2" sometimes did not return
correct status value.

* nd/diff-quiet-stat-dirty:
diff: do not quit early on stat-dirty files
diff.c: move diffcore_skip_stat_unmatch core logic out for reuse later

Merge branch 'nd/submodule-pathspec-ending-with-slash'Junio C Hamano Thu, 27 Feb 2014 22:01:15 +0000 (14:01 -0800)

Merge branch 'nd/submodule-pathspec-ending-with-slash'

Allow "git cmd path/", when the 'path' is where a submodule is
bound to the top-level working tree, to match 'path', despite the
extra and unnecessary trailing slash.

* nd/submodule-pathspec-ending-with-slash:
clean: use cache_name_is_other()
clean: replace match_pathspec() with dir_path_match()
pathspec: pass directory indicator to match_pathspec_item()
match_pathspec: match pathspec "foo/" against directory "foo"
dir.c: prepare match_pathspec_item for taking more flags
pathspec: rename match_pathspec_depth() to match_pathspec()
pathspec: convert some match_pathspec_depth() to dir_path_match()
pathspec: convert some match_pathspec_depth() to ce_path_match()

Merge branch 'bk/refresh-missing-ok-in-merge-recursive'Junio C Hamano Thu, 27 Feb 2014 22:01:14 +0000 (14:01 -0800)

Merge branch 'bk/refresh-missing-ok-in-merge-recursive'

Allow "merge-recursive" to work in an empty (temporary) working
tree again when there are renames involved, correcting an old
regression in 1.7.7 era.

* bk/refresh-missing-ok-in-merge-recursive:
merge-recursive.c: tolerate missing files while refreshing index
read-cache.c: extend make_cache_entry refresh flag with options
read-cache.c: refactor --ignore-missing implementation
t3030-merge-recursive: test known breakage with empty work tree

Merge branch 'da/pull-ff-configuration'Junio C Hamano Thu, 27 Feb 2014 22:01:11 +0000 (14:01 -0800)

Merge branch 'da/pull-ff-configuration'

"git pull" learned to pay attention to pull.ff configuration
variable.

* da/pull-ff-configuration:
pull: add --ff-only to the help text
pull: add pull.ff configuration

Merge branch 'kb/fast-hashmap'Junio C Hamano Thu, 27 Feb 2014 22:01:09 +0000 (14:01 -0800)

Merge branch 'kb/fast-hashmap'

Improvements to our hash table to get it to meet the needs of the
msysgit fscache project, with some nice performance improvements.

* kb/fast-hashmap:
name-hash: retire unused index_name_exists()
hashmap.h: use 'unsigned int' for hash-codes everywhere
test-hashmap.c: drop unnecessary #includes
.gitignore: test-hashmap is a generated file
read-cache.c: fix memory leaks caused by removed cache entries
builtin/update-index.c: cleanup update_one
fix 'git update-index --verbose --again' output
remove old hash.[ch] implementation
name-hash.c: remove cache entries instead of marking them CE_UNHASHED
name-hash.c: use new hash map implementation for cache entries
name-hash.c: remove unreferenced directory entries
name-hash.c: use new hash map implementation for directories
diffcore-rename.c: use new hash map implementation
diffcore-rename.c: simplify finding exact renames
diffcore-rename.c: move code around to prepare for the next patch
buitin/describe.c: use new hash map implementation
add a hashtable implementation that supports O(1) removal
submodule: don't access the .gitmodules cache entry after removing it

Merge branch 'nv/commit-gpgsign-config'Junio C Hamano Thu, 27 Feb 2014 22:01:03 +0000 (14:01 -0800)

Merge branch 'nv/commit-gpgsign-config'

Introduce commit.gpgsign configuration variable to force every
commit to be GPG signed. The variable cannot be overriden from the
command line of some of the commands that create commits except for
"git commit" and "git commit-tree", but I am not convinced that it
is a good idea to sprinkle support for --no-gpg-sign everywhere,
which in turn means that this configuration variable may not be
such a good idea.

* nv/commit-gpgsign-config:
test the commit.gpgsign config option
commit-tree: add and document --no-gpg-sign
commit-tree: add the commit.gpgsign option to sign all commits

builtin/blame.c::find_copy_in_blob: no need to scan... David Kastrup Sat, 22 Feb 2014 16:02:47 +0000 (17:02 +0100)

builtin/blame.c::find_copy_in_blob: no need to scan for region end

The region end can be looked up just like its beginning.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

name-hash: retire unused index_name_exists()Eric Sunshine Thu, 2 Jan 2014 21:57:12 +0000 (16:57 -0500)

name-hash: retire unused index_name_exists()

db5360f3f496 (name-hash: refactor polymorphic index_name_exists();
2013-09-17) split index_name_exists() into index_file_exists() and
index_dir_exists() but retained index_name_exists() as a thin wrapper
to avoid disturbing possible in-flight topics. Since this change
landed in 'master' some time ago and there are no in-flight topics
referencing index_name_exists(), retire it.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

hashmap.h: use 'unsigned int' for hash-codes everywhereKarsten Blees Wed, 18 Dec 2013 13:41:27 +0000 (14:41 +0100)

hashmap.h: use 'unsigned int' for hash-codes everywhere

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test the commit.gpgsign config optionNicolas Vigier Mon, 16 Dec 2013 13:55:04 +0000 (14:55 +0100)

test the commit.gpgsign config option

The tests are checking that :

- when commit.gpgsign is true, "git commit" creates signed commits

- when commit.gpgsign is false, "git commit" creates unsigned commits

- when commit.gpgsign is true, "git commit --no-gpg-sign" creates
unsigned commits

- when commit.gpgsign is true, "git rebase -f" creates signed commits

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit-tree: add and document --no-gpg-signJunio C Hamano Fri, 13 Dec 2013 23:40:35 +0000 (15:40 -0800)

commit-tree: add and document --no-gpg-sign

Document how to override commit.gpgsign configuration that is set to
true per "git commit" invocation (parse-options machinery lets us
say "--no-gpg-sign" to do so).

"git commit-tree" does not use parse-options, so manually add the
corresponding option for now.

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

commit-tree: add the commit.gpgsign option to sign... Nicolas Vigier Mon, 4 Nov 2013 23:14:41 +0000 (00:14 +0100)

commit-tree: add the commit.gpgsign option to sign all commits

If you want to GPG sign all your commits, you have to add the -S option
all the time. The commit.gpgsign config option allows to sign all
commits automatically.

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: do not quit early on stat-dirty filesNguyễn Thái Ngọc Duy Sat, 25 Jan 2014 06:46:50 +0000 (13:46 +0700)

diff: do not quit early on stat-dirty files

When QUICK is set (i.e. with --quiet) we try to do as little work as
possible, stopping after seeing the first change. stat-dirty is
considered a "change" but it may turn out not, if no actual content is
changed. The actual content test is performed too late in the process
and the shortcut may be taken prematurely, leading to incorrect return
code.

Assume we do "git diff --quiet". If we have a stat-dirty file "a" and
a really dirty file "b". We break the loop in run_diff_files() and
stop after "a" because we have got a "change". Later in
diffcore_skip_stat_unmatch() we find out "a" is actually not
changed. But there's nothing else in the diff queue, we incorrectly
declare "no change", ignoring the fact that "b" is changed.

This also happens to "git diff --quiet HEAD" when it hits
diff_can_quit_early() in oneway_diff().

This patch does the content test earlier in order to keep going if "a"
is unchanged. The test result is cached so that when
diffcore_skip_stat_unmatch() is done in the end, we spend no cycles on
re-testing "a".

Reported-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: move diffcore_skip_stat_unmatch core logic... Nguyễn Thái Ngọc Duy Sat, 25 Jan 2014 06:46:49 +0000 (13:46 +0700)

diff.c: move diffcore_skip_stat_unmatch core logic out for reuse later

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

tests: add checking that combine-diff emits only correc... Kirill Smelkov Mon, 3 Feb 2014 09:08:49 +0000 (13:08 +0400)

tests: add checking that combine-diff emits only correct paths

where "correct paths" stands for paths that are different to all
parents.

Up until now, we were testing combined diff only on one file, or on
several files which were all different (t4038-diff-combined.sh).

As recent thinko in "simplify intersect_paths() further" showed, and
also, since we are going to rework code for finding paths different to
all parents, lets write at least basic tests.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

combine-diff: simplify intersect_paths() furtherJunio C Hamano Tue, 28 Jan 2014 21:55:59 +0000 (13:55 -0800)

combine-diff: simplify intersect_paths() further

Linus once said:

I actually wish more people understood the really core low-level
kind of coding. Not big, complex stuff like the lockless name
lookup, but simply good use of pointers-to-pointers etc. For
example, I've seen too many people who delete a singly-linked
list entry by keeping track of the "prev" entry, and then to
delete the entry, doing something like

if (prev)
prev->next = entry->next;
else
list_head = entry->next;

and whenever I see code like that, I just go "This person
doesn't understand pointers". And it's sadly quite common.

People who understand pointers just use a "pointer to the entry
pointer", and initialize that with the address of the
list_head. And then as they traverse the list, they can remove
the entry without using any conditionals, by just doing a "*pp =
entry->next".

Applying that simplification lets us lose 7 lines from this function
even while adding 2 lines of comment.

I was tempted to squash this into the original commit, but because
the benchmarking described in the commit log is without this
simplification, I decided to keep it a separate follow-up patch.

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

combine-diff: combine_diff_path.len is not needed anymoreKirill Smelkov Mon, 20 Jan 2014 16:20:41 +0000 (20:20 +0400)

combine-diff: combine_diff_path.len is not needed anymore

The field was used in order to speed-up name comparison and also to
mark removed paths by setting it to 0.

Because the updated code does significantly less strcmp and also
just removes paths from the list and free right after we know a path
will not be needed, it is not needed anymore.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

combine-diff: optimize combine_diff_path sets intersectionKirill Smelkov Mon, 20 Jan 2014 16:20:40 +0000 (20:20 +0400)

combine-diff: optimize combine_diff_path sets intersection

When generating combined diff, for each commit, we intersect diff
paths from diff(parent_0,commit) to diff(parent_i,commit) comparing
all paths pairs, i.e. doing it the quadratic way. That is correct,
but could be optimized.

Paths come from trees in sorted (= tree) order, and so does diff_tree()
emits resulting paths in that order too. Now if we look at diffcore
transformations, all of them, except diffcore_order, preserve resulting
path ordering:

- skip_stat_unmatch, grep, pickaxe, filter
-- just skip elements -> order stays preserved

- break -- just breaks diff for a path, adding path
dup after the path -> order stays preserved

- detect rename/copy -- resulting paths are emitted sorted
(verified empirically)

So only diffcore_order changes diff paths ordering.

But diffcore_order meaning affects only presentation - i.e. only how to
show the diff, so we could do all the internal computations without
paths reordering, and order only resultant paths set. This is faster,
since, if we know two paths sets are all ordered, their intersection
could be done in linear time.

This patch does just that.

Timings for `git log --raw --no-abbrev --no-renames` without `-c` ("git log")
and with `-c` ("git log -c") before and after the patch are as follows:

linux.git v3.10..v3.11

log log -c

before 1.9s 20.4s
after 1.9s 16.6s

navy.git (private repo)

log log -c

before 0.83s 15.6s
after 0.83s 2.1s

P.S.

I think linux.git case is sped up not so much as the second one, since
in navy.git, there are more exotic (subtree, etc) merges.

P.P.S.

My tracing showed that the rest of the time (16.6s vs 1.9s) is usually
spent in computing huge diffs from commit to second parent. Will try to
deal with it, if I'll have time.

P.P.P.S.

For combine_diff_path, ->len is not needed anymore - will remove it in
the next noisy cleanup path, to maintain good signal/noise ratio here.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff test: add tests for combine-diff with orderfileKirill Smelkov Mon, 20 Jan 2014 16:20:39 +0000 (20:20 +0400)

diff test: add tests for combine-diff with orderfile

In the next patch combine-diff will have special code-path for taking
orderfile into account. Prepare for making changes by introducing
coverage tests for that case.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-order: export generic ordering interfaceKirill Smelkov Mon, 20 Jan 2014 16:20:38 +0000 (20:20 +0400)

diffcore-order: export generic ordering interface

diffcore_order() interface only accepts a queue of `struct
diff_filepair`.

In the next patches, we'll want to order `struct combine_diff_path`
by path, so let's first rework diffcore-order to also provide
generic low-level interface for ordering arbitrary objects, provided
they have path accessors.

The new interface is:

- `struct obj_order` for describing objects to ordering routine, and
- order_objects() for actually doing the ordering work.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-walk: finally switch over tree descriptors to... Kirill Smelkov Thu, 6 Feb 2014 11:36:31 +0000 (15:36 +0400)

tree-walk: finally switch over tree descriptors to contain a pre-parsed entry

This continues 4651ece8 (Switch over tree descriptors to contain a
pre-parsed entry) and moves the only rest computational part

mode = canon_mode(mode)

from tree_entry_extract() to tree entry decode phase - to
decode_tree_entry().

The reason to do it, is that canon_mode() is at least 2 conditional
jumps for regular files, and that could be noticeable should canon_mode()
be invoked several times.

That does not matter for current Git codebase, where typical tree
traversal is

while (t->size) {
sha1 = tree_entry_extract(t, &path, &mode);
...
update_tree_entry(t);
}

i.e. we do t -> sha1,path.mode "extraction" only once per entry. In such
cases, it does not matter performance-wise, where that mode
canonicalization is done - either once in tree_entry_extract(), or once
in decode_tree_entry() called by update_tree_entry() - it is
approximately the same.

But for future code, which could need to work with several tree_desc's
in parallel, it could be handy to operate on tree_desc descriptors, and
do "extracts" only when needed, or at all, access only relevant part of
it through structure fields directly.

And for such situations, having canon_mode() be done once in decode
phase is better - we won't need to pay the performance price of 2 extra
conditional jumps on every t->mode access.

So let's move mode canonicalization to decode_tree_entry(). That was the
final bit. Now after tree entry is decoded, it is fully ready and could
be accessed either directly via field, or through tree_entry_extract()
which this time got really "totally trivial".

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clean: use cache_name_is_other()Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:35 +0000 (20:40 +0700)

clean: use cache_name_is_other()

cmd_clean() has the exact same code of index_name_is_other(). Reduce
code duplication.

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

clean: replace match_pathspec() with dir_path_match()Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:34 +0000 (20:40 +0700)

clean: replace match_pathspec() with dir_path_match()

This instance was left out when many match_pathspec() call sites that
take input from dir_entry were converted to dir_path_match() because
it passed a path with the trailing slash stripped out to match_pathspec()
while the others did not. Stripping for all call sites back then would
be a regression because match_pathspec() did not know how to match
pathspec foo/ against _directory_ foo (the stripped version of path
"foo/").

match_pathspec() knows how to do it now. And dir_path_match() strips
the trailing slash also. Use the new function, because the stripping
code is removed in the next patch.

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

pathspec: pass directory indicator to match_pathspec_item()Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:33 +0000 (20:40 +0700)

pathspec: pass directory indicator to match_pathspec_item()

This patch activates the DO_MATCH_DIRECTORY code in m_p_i(), which
makes "git diff HEAD submodule/" and "git diff HEAD submodule" produce
the same output. Previously only the version without trailing slash
returns the difference (if any).

That's the effect of new ce_path_match(). dir_path_match() is not
executed by the new tests. And it should not introduce regressions.

Previously if path "dir/" is passed in with pathspec "dir/", they
obviously match. With new dir_path_match(), the path becomes
_directory_ "dir" vs pathspec "dir/", which is not executed by the old
code path in m_p_i(). The new code path is executed and produces the
same result.

The other case is pathspec "dir" and path "dir/" is now turned to
"dir" (with DO_MATCH_DIRECTORY). Still the same result before or after
the patch.

So why change? Because of the next patch about clean.c.

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

match_pathspec: match pathspec "foo/" against directory... Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:32 +0000 (20:40 +0700)

match_pathspec: match pathspec "foo/" against directory "foo"

Currently we do support matching pathspec "foo/" against directory
"foo". That is because match_pathspec() has no way to tell "foo" is a
directory and matching "foo/" against _file_ "foo" is wrong.

The callers can now tell match_pathspec if "foo" is a directory, we
could make an exception for this case. Code is not executed though
because no callers pass the flag yet.

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

dir.c: prepare match_pathspec_item for taking more... Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:31 +0000 (20:40 +0700)

dir.c: prepare match_pathspec_item for taking more flags

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

pathspec: rename match_pathspec_depth() to match_pathspec()Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:30 +0000 (20:40 +0700)

pathspec: rename match_pathspec_depth() to match_pathspec()

A long time ago, for some reason I was not happy with
match_pathspec(). I created a better version, match_pathspec_depth()
that was suppose to replace match_pathspec()
eventually. match_pathspec() has finally been gone since 6 months
ago. Use the shorter name for match_pathspec_depth().

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

pathspec: convert some match_pathspec_depth() to dir_pa... Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:29 +0000 (20:40 +0700)

pathspec: convert some match_pathspec_depth() to dir_path_match()

This helps reduce the number of match_pathspec_depth() call sites and
show how m_p_d() is used. And it usage is:

- match against an index entry (ce_path_match or match_pathspec_depth
in ls-files)

- match against a dir_entry from read_directory (dir_path_match and
match_pathspec_depth in clean.c, which will be converted later)

- resolve-undo (rerere.c and ls-files.c)

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

pathspec: convert some match_pathspec_depth() to ce_pat... Nguyễn Thái Ngọc Duy Fri, 24 Jan 2014 13:40:28 +0000 (20:40 +0700)

pathspec: convert some match_pathspec_depth() to ce_path_match()

This helps reduce the number of match_pathspec_depth() call sites and
show how match_pathspec_depth() is used.

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

Documentation: describe 'submodule update --remote... W. Trevor King Sun, 26 Jan 2014 20:45:16 +0000 (12:45 -0800)

Documentation: describe 'submodule update --remote' use case

Make it clear that there is no implicit floating going on; --remote
lets you explicitly integrate the upstream branch in your current
HEAD (just like running 'git pull' in the submodule). The only
distinction with the current 'git pull' is the config location and
setting used for the upstream branch, which is hopefully clear now.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: explicit local branch creation in module_cloneW. Trevor King Sun, 26 Jan 2014 20:45:15 +0000 (12:45 -0800)

submodule: explicit local branch creation in module_clone

The previous code only checked out branches in cmd_add. This commit
moves the branch-checkout logic into module_clone, where it can be
shared by cmd_add and cmd_update. I also update the initial checkout
command to use 'reset' to preserve branches setup during module_clone.

With this change, folks cloning submodules for the first time via:

$ git submodule update ...

will get a local branch instead of a detached HEAD, unless they are
using the default checkout-mode updates. This is a change from the
previous situation where cmd_update always used checkout-mode logic
(regardless of the requested update mode) for updates that triggered
an initial clone, which always resulted in a detached HEAD.

This commit does not change the logic for updates after the initial
clone, which will continue to create detached HEADs for checkout-mode
updates, and integrate remote work with the local HEAD (detached or
not) in other modes.

The motivation for the change is that developers doing local work
inside the submodule are likely to select a non-checkout-mode for
updates so their local work is integrated with upstream work.
Developers who are not doing local submodule work stick with
checkout-mode updates so any apparently local work is blown away
during updates. For example, if upstream rolls back the remote branch
or gitlinked commit to an earlier version, the checkout-mode developer
wants their old submodule checkout to be rolled back as well, instead
of getting a no-op merge/rebase with the rolled-back reference.

By using the update mode to distinguish submodule developers from
black-box submodule consumers, we can setup local branches for the
developers who will want local branches, and stick with detached HEADs
for the developers that don't care.

Testing
=======

In t7406, just-cloned checkouts now update to the gitlinked hash with
'reset', to preserve the local branch for situations where we're not
on a detached HEAD.

I also added explicit tests to t7406 for HEAD attachement after
cloning updates, showing that it depends on their update mode:

* Checkout-mode updates get detached HEADs
* Everyone else gets a local branch, matching the configured
submodule.<name>.branch and defaulting to master.

The 'initial-setup' tag makes it easy to reset the superproject to a
known state, as several earlier tests commit to submodules and commit
the changed gitlinks to the superproject, but don't push the new
submodule commits to the upstream subprojects. This makes it
impossible to checkout the current super master, because it references
submodule commits that don't exist in the upstream subprojects. For a
specific example, see the tests that currently generate the
'two_new_submodule_commits' commits.

Documentation
=============

I updated the docs to describe the 'submodule update' modes in detail.
The old documentation did not distinguish between cloning and
non-cloning updates and lacked clarity on which operations would lead
to detached HEADs, and which would not. The new documentation
addresses these issues while updating the docs to reflect the changes
introduced by this commit's explicit local branch creation in
module_clone.

I also add '--checkout' to the usage summary and group the update-mode
options into a single set.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: document module_clone arguments in commentsW. Trevor King Thu, 16 Jan 2014 04:10:23 +0000 (20:10 -0800)

submodule: document module_clone arguments in comments

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: make 'checkout' update_module mode more... W. Trevor King Thu, 16 Jan 2014 04:10:22 +0000 (20:10 -0800)

submodule: make 'checkout' update_module mode more explicit

This avoids the current awkwardness of having either '' or 'checkout'
for checkout-mode updates, which makes testing for checkout-mode
updates (or non-checkout-mode updates) easier.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-hashmap.c: drop unnecessary #includesJonathan Nieder Sat, 14 Dec 2013 02:06:40 +0000 (18:06 -0800)

test-hashmap.c: drop unnecessary #includes

Per Documentation/CodingGuidelines most C files in git start with
a #include of git-compat-util.h or another header file that includes
it, such as cache.h or builtin.h. This file doesn't need anything
beyond "git-compat-util.h", so use that.

Remove a #include of the system header <stdio.h> since it is already
included by "git-compat-util.h".

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

.gitignore: test-hashmap is a generated fileJonathan Nieder Sat, 14 Dec 2013 02:05:26 +0000 (18:05 -0800)

.gitignore: test-hashmap is a generated file

Prevent the "test-hashmap" program from being accidentally tracked
with "git add" or cluttering "git status" output.

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

blame.c: prepare_lines should not call xrealloc for... David Kastrup Wed, 12 Feb 2014 14:27:24 +0000 (15:27 +0100)

blame.c: prepare_lines should not call xrealloc for every line

Making a single preparation run for counting the lines will avoid memory
fragmentation. Also, fix the allocated memory size which was wrong
when sizeof(int *) != sizeof(int), and would have been too small
for sizeof(int *) < sizeof(int), admittedly unlikely.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/blame.c::prepare_lines: fix allocation size... David Kastrup Sat, 8 Feb 2014 09:19:26 +0000 (10:19 +0100)

builtin/blame.c::prepare_lines: fix allocation size of sb->lineno

If we are calling xrealloc on every single line, the least we can do
is get the right allocation size.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/blame.c: eliminate same_suspect()David Kastrup Wed, 22 Jan 2014 00:20:15 +0000 (01:20 +0100)

builtin/blame.c: eliminate same_suspect()

Since the origin pointers are "interned" and reference-counted, comparing
the pointers rather than the content is enough. The only uninterned
origins are cached values kept in commit->util, but same_suspect is not
called on them.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive.c: tolerate missing files while refresh... Brad King Mon, 27 Jan 2014 14:45:09 +0000 (09:45 -0500)

merge-recursive.c: tolerate missing files while refreshing index

Teach add_cacheinfo to tell make_cache_entry to skip refreshing stat
information when a file is missing from the work tree. We do not want
the index to be stat-dirty after the merge but also do not want to fail
when a file happens to be missing.

This fixes the 'merge-recursive w/ empty work tree - ours has rename'
case in t3030-merge-recursive.

Suggested-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache.c: extend make_cache_entry refresh flag... Brad King Mon, 27 Jan 2014 14:45:08 +0000 (09:45 -0500)

read-cache.c: extend make_cache_entry refresh flag with options

Convert the make_cache_entry boolean 'refresh' argument to a more
general 'refresh_options' argument. Pass the value through to the
underlying refresh_cache_ent call. Add option CE_MATCH_REFRESH to
enable stat refresh. Update call sites to use the new signature.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache.c: refactor --ignore-missing implementationBrad King Mon, 27 Jan 2014 14:45:07 +0000 (09:45 -0500)

read-cache.c: refactor --ignore-missing implementation

Move lstat ENOENT handling from refresh_index to refresh_cache_ent and
activate it with a new CE_MATCH_IGNORE_MISSING option. This will allow
other call paths into refresh_cache_ent to use the feature.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3030-merge-recursive: test known breakage with empty... Brad King Mon, 27 Jan 2014 14:45:06 +0000 (09:45 -0500)

t3030-merge-recursive: test known breakage with empty work tree

Sometimes when working with a large repository it can be useful to try
out a merge and only check out conflicting files to disk (for example as
a speed optimization on a server). Until v1.7.7-rc1~28^2~20
(merge-recursive: When we detect we can skip an update, actually skip
it, 2011-08-11), it was possible to do so with the following idiom:

# Prepare a temporary index and empty work tree.
GIT_INDEX_FILE="$PWD/tmp-$$-index" &&
export GIT_INDEX_FILE &&
GIT_WORK_TREE="$PWD/tmp-$$-work" &&
export GIT_WORK_TREE &&
mkdir "$GIT_WORK_TREE" &&

# Convince the index that our side is on disk.
git read-tree -i -m $ours &&
git update-index --ignore-missing --refresh &&

# Merge their side into our side.
bases=$(git merge-base --all $ours $theirs) &&
git merge-recursive $bases -- $ours $theirs &&
tree=$(git write-tree)

Nowadays, that still works and the exit status is the same, but
merge-recursive produces a diagnostic if "our" side renamed a file:

error: addinfo_cache failed for path 'dst'

Add a test to document this regression.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.9.0 v1.9.0Junio C Hamano Fri, 14 Feb 2014 19:35:04 +0000 (11:35 -0800)

Git 1.9.0

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

release notes: typo fixesMichael J Gruber Thu, 13 Feb 2014 10:35:08 +0000 (11:35 +0100)

release notes: typo fixes

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: turn on network daemon tests by defaultJeff King Mon, 10 Feb 2014 21:29:37 +0000 (16:29 -0500)

tests: turn on network daemon tests by default

We do not run the httpd nor git-daemon tests by default, as
they are rather heavyweight and require network access
(albeit over localhost). However, it would be nice if more
pepole ran them, for two reasons:

1. We would get more test coverage on more systems.

2. The point of the test suite is to find regressions. It
is very easy to change some of the underlying code and
break the httpd code without realizing you are even
affecting it. Running the httpd tests helps find these
problems sooner (ideally before the patches even hit
the list).

We still want to leave an "out", though, for people who really do
not want to run them. For that reason, the GIT_TEST_HTTPD and
GIT_TEST_GIT_DAEMON variables are now tri-state booleans
(true/false/auto), so you can say GIT_TEST_HTTPD=false to turn the
tests back off. To support those who want a stable single way to
disable these tests across versions of Git before and after this
change, an empty string explicitly set to these variables is also
taken as "false", so the behaviour changes only for those who:

a. did not express any preference by leaving these variables
unset. They did not test these features before, but now they
do; or

b. did express that they want to test these features by setting
GIT_TEST_FEATURE=false (or any equivalent other ways to tell
"false" to Git, e.g. "0"), which has been a valid but funny way
to say that they do want to test the feature only because we
used to interpret any non-empty string to mean "yes please
test". They no longer test that feature.

In addition, we are forgiving of common setup failures (e.g., you do
not have apache installed, or have an old version) when the
tri-state is "auto" (or unset), but report an error when it is
"true". This makes "auto" a sane default, as we should not cause
failures on setups where the tests cannot run. But it allows people
who use "true" to catch regressions in their system (e.g., they
uninstalled apache, but were expecting their automated test runs to
test git-httpd, and would want to be notified).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.8.5.5Junio C Hamano Thu, 13 Feb 2014 21:42:26 +0000 (13:42 -0800)

Sync with 1.8.5.5

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

Git 1.8.5.5 v1.8.5.5Junio C Hamano Thu, 13 Feb 2014 21:40:47 +0000 (13:40 -0800)

Git 1.8.5.5

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

Merge branch 'bm/merge-base-octopus-dedup' into maintJunio C Hamano Thu, 13 Feb 2014 21:38:59 +0000 (13:38 -0800)

Merge branch 'bm/merge-base-octopus-dedup' into maint

"git merge-base --octopus" used to leave cleaning up suboptimal
result to the caller, but now it does the clean-up itself.

* bm/merge-base-octopus-dedup:
merge-base --octopus: reduce the result from get_octopus_merge_bases()
merge-base: separate "--independent" codepath into its own helper

Merge branch 'jc/revision-range-unpeel' into maintJunio C Hamano Thu, 13 Feb 2014 21:38:47 +0000 (13:38 -0800)

Merge branch 'jc/revision-range-unpeel' into maint

"git log --left-right A...B" lost the "leftness" of commits
reachable from A when A is a tag as a side effect of a recent
bugfix. This is a regression in 1.8.4.x series.

* jc/revision-range-unpeel:
revision: propagate flag bits from tags to pointees
revision: mark contents of an uninteresting tree uninteresting

Merge branch 'jk/allow-fetch-onelevel-refname' into... Junio C Hamano Thu, 13 Feb 2014 21:38:34 +0000 (13:38 -0800)

Merge branch 'jk/allow-fetch-onelevel-refname' into maint

"git clone" would fail to clone from a repository that has a ref
directly under "refs/", e.g. "refs/stash", because different
validation paths do different things on such a refname. Loosen the
client side's validation to allow such a ref.

* jk/allow-fetch-onelevel-refname:
fetch-pack: do not filter out one-level refs

Merge branch 'jk/interpret-branch-name-fix' into maintJunio C Hamano Thu, 13 Feb 2014 21:38:25 +0000 (13:38 -0800)

Merge branch 'jk/interpret-branch-name-fix' into maint

A handful of bugs around interpreting $branch@{upstream} notation
and its lookalike, when $branch part has interesting characters,
e.g. "@", and ":", have been fixed.

* jk/interpret-branch-name-fix:
interpret_branch_name: find all possible @-marks
interpret_branch_name: avoid @{upstream} past colon
interpret_branch_name: always respect "namelen" parameter
interpret_branch_name: rename "cp" variable to "at"
interpret_branch_name: factor out upstream handling

Merge branch 'rk/send-email-ssl-cert' into maintJunio C Hamano Thu, 13 Feb 2014 21:38:19 +0000 (13:38 -0800)

Merge branch 'rk/send-email-ssl-cert' into maint

A recent update to "git send-email" broke platforms where
/etc/ssl/certs/ directory exists but cannot be used as SSL_ca_path
(e.g. Fedora rawhide).

* rk/send-email-ssl-cert:
send-email: /etc/ssl/certs/ directory may not be usable as ca_path

Merge branch 'sb/repack-in-c' into maintJunio C Hamano Thu, 13 Feb 2014 21:38:09 +0000 (13:38 -0800)

Merge branch 'sb/repack-in-c' into maint

"git repack --max-pack-size=8g" stopped being parsed correctly when
the command was reimplemented in C.

* sb/repack-in-c:
repack: propagate pack-objects options as strings
repack: make parsed string options const-correct
repack: fix typo in max-pack-size option

Merge branch 'as/tree-walk-fix-aggressive-short-cut... Junio C Hamano Thu, 13 Feb 2014 21:37:53 +0000 (13:37 -0800)

Merge branch 'as/tree-walk-fix-aggressive-short-cut' into maint

The pathspec matching code, while comparing two trees (e.g. "git
diff A B -- path1 path2") was too aggressive and failed to match
some paths when multiple pathspecs were involved.

* as/tree-walk-fix-aggressive-short-cut:
tree_entry_interesting: match against all pathspecs

t5537: move http tests out to t5539Nguyễn Thái Ngọc Duy Thu, 13 Feb 2014 13:21:14 +0000 (20:21 +0700)

t5537: move http tests out to t5539

start_httpd is supposed to be at the beginning of the test file, not
the middle of it. The "test_seq" line in "no shallow lines.." test is
updated to compensate missing refs that are there in t5537, but not in
the new t5539.

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Wed, 12 Feb 2014 20:28:47 +0000 (12:28 -0800)

Merge git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
l10n: de.po: correct message when hiding commits by craft
l10n: de.po: translate 28 new messages

ewah: unconditionally ntohll ewah dataJeff King Wed, 12 Feb 2014 16:48:28 +0000 (11:48 -0500)

ewah: unconditionally ntohll ewah data

Commit a201c20 tried to optimize out a loop like:

for (i = 0; i < len; i++)
data[i] = ntohll(data[i]);

in the big-endian case, because we know that ntohll is a
noop, and we do not need to pay the cost of the loop at all.
However, it mistakenly assumed that __BYTE_ORDER was always
defined, whereas it may not be on systems which do not
define it by default, and where we did not need to define it
to set up the ntohll macro. This includes OS X and Windows.

We could muck with the ordering in compat/bswap.h to make
sure it is defined unconditionally, but it is simpler to
still to just execute the loop unconditionally. That avoids
the application code knowing anything about these magic
macros, and lets it depend only on having ntohll defined.

And since the resulting loop looks like (on a big-endian
system):

for (i = 0; i < len; i++)
data[i] = data[i];

any decent compiler can probably optimize it out.

Original report and analysis by Brian Gernhardt.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: correct message when hiding commits by... Ralf Thielow Sat, 8 Feb 2014 21:01:36 +0000 (22:01 +0100)

l10n: de.po: correct message when hiding commits by craft

The recent translation was giving the idea that all commits
based on a graft were meant to be hidden. Make it clear that
it is the graft commit itself.

Reported-by: David Kastrup <dak@gnu.org>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

l10n: de.po: translate 28 new messagesRalf Thielow Fri, 3 Jan 2014 17:38:12 +0000 (18:38 +0100)

l10n: de.po: translate 28 new messages

Translate 28 new messages came from git.pot update in
df49095 (l10n: git.pot: v1.9 round 1 (27 new, 11 removed)
and d57b24b (l10n: git.pot: v1.9 round 2 (1 new)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

pull: add the --gpg-sign option.brian m. carlson Mon, 10 Feb 2014 01:03:38 +0000 (01:03 +0000)

pull: add the --gpg-sign option.

git merge already allows us to sign commits, and git rebase has recently
learned how to do so as well. Teach git pull to parse the -S/--gpg-sign
option and pass this along to merge or rebase, as appropriate.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: add the --gpg-sign optionNicolas Vigier Mon, 10 Feb 2014 01:03:37 +0000 (01:03 +0000)

rebase: add the --gpg-sign option

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: parse options in stuck-long modeNicolas Vigier Mon, 10 Feb 2014 01:03:36 +0000 (01:03 +0000)

rebase: parse options in stuck-long mode

There is no functional change. The reason for this change is to be able
to add a new option taking an optional argument.

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs/git-blame: explain more clearly the example pickax... Albert L. Lash, IV Sat, 8 Feb 2014 20:41:37 +0000 (15:41 -0500)

docs/git-blame: explain more clearly the example pickaxe use

We state that the following paragraph mentions the pickaxe
interface, but the term pickaxe is not then used. This
change clarifies that the example command uses the pickaxe
interface and what it is searching for.

Signed-off-by: Albert L. Lash, IV <alash3@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs/git-clone: clarify use of --no-hardlinks optionAlbert L. Lash, IV Sat, 8 Feb 2014 20:41:36 +0000 (15:41 -0500)

docs/git-clone: clarify use of --no-hardlinks option

Current text claims optimization, implying the use of
hardlinks, when this option ratchets down the level of
efficiency. This change explains the difference made by
using this option, namely copying instead of hardlinking,
and why it may be useful.

Signed-off-by: Albert L. Lash, IV <alash3@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs/git-remote: capitalize first word of initial blurbAlbert L. Lash, IV Sat, 8 Feb 2014 20:41:35 +0000 (15:41 -0500)

docs/git-remote: capitalize first word of initial blurb

All other man files have capitalized descriptions which
immediately follow the command's name. Let's capitalize
this one too for consistency.

Signed-off-by: Albert L. Lash, IV <alash3@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs/merge-strategies: remove hyphen from mis-mergesAlbert L. Lash, IV Sat, 8 Feb 2014 20:41:34 +0000 (15:41 -0500)

docs/merge-strategies: remove hyphen from mis-merges

The term mismerges without hyphen is used a few other
places in the documentation. Let's update this to
be consistent.

Signed-off-by: Albert L. Lash, IV <alash3@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://github.com/git-l10n/git-poJunio C Hamano Tue, 11 Feb 2014 19:02:05 +0000 (11:02 -0800)

Merge git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
l10n: zh_CN.po: Disambiguation for rebase
l10n: zh_CN.po: translate 1 new message (2211t0f0u)
l10n: vi.po (2211t): Updated one new string
l10n: Update Swedish translation (2211t0f0u)
l10n: fr: 1.9rc2 2211t
l10n: git.pot: v1.9 round 2 (1 new)

tests: auto-set git-daemon portJeff King Mon, 10 Feb 2014 19:16:38 +0000 (14:16 -0500)

tests: auto-set git-daemon port

A recent commit taught lib-httpd to always start apache on
the same port as the numbered tests. Let's do the same for
the git-daemon tests.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gc: config option for running --auto in backgroundNguyễn Thái Ngọc Duy Sat, 8 Feb 2014 07:08:52 +0000 (14:08 +0700)

gc: config option for running --auto in background

`gc --auto` takes time and can block the user temporarily (but not any
less annoyingly). Make it run in background on systems that support
it. The only thing lost with running in background is printouts. But
gc output is not really interesting. You can keep it in foreground by
changing gc.autodetach.

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

daemon: move daemonize() to libgit.aNguyễn Thái Ngọc Duy Sat, 8 Feb 2014 07:08:51 +0000 (14:08 +0700)

daemon: move daemonize() to libgit.a

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

fetch-pack: fix deepen shallow over smart http with... Nguyễn Thái Ngọc Duy Thu, 6 Feb 2014 15:10:39 +0000 (22:10 +0700)

fetch-pack: fix deepen shallow over smart http with no-done cap

In smart http, upload-pack adds new shallow lines at the beginning of
each rpc response. Only shallow lines from the first rpc call are
useful. After that they are thrown away. It's designed this way
because upload-pack is stateless and has no idea when its shallow
lines are helpful or not.

So after refs are negotiated with multi_ack_detailed and the server
thinks it learned enough, it sends "ACK obj-id ready", terminates the
rpc call and waits for the final rpc round. The client sends "done".
The server sends another response, which also has shallow lines at
the beginning, and the last "ACK obj-id" line.

When no-done is active, the last round is cut out, the server sends
"ACK obj-id ready" and "ACK obj-id" in the same rpc
response. fetch-pack is updated to recognize this and not send
"done". However it still tries to consume shallow lines, which are
never sent.

Update the code, make sure to skip consuming shallow lines when
no-done is enabled.

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

protocol-capabilities.txt: document no-doneNguyễn Thái Ngọc Duy Thu, 6 Feb 2014 15:10:38 +0000 (22:10 +0700)

protocol-capabilities.txt: document no-done

See 3e63b21 (upload-pack: Implement no-done capability - 2011-03-14)
and 761ecf0 (fetch-pack: Implement no-done capability - 2011-03-14)
for more information.

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

protocol-capabilities.txt: refer multi_ack_detailed... Nguyễn Thái Ngọc Duy Thu, 6 Feb 2014 15:10:37 +0000 (22:10 +0700)

protocol-capabilities.txt: refer multi_ack_detailed back to pack-protocol.txt

pack-protocol.txt explains in detail how multi_ack_detailed works and
what's the difference between no multi_ack, multi_ack and
multi_ack_detailed. No need to repeat here.

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

pack-protocol.txt: clarify 'obj-id' in the last ACK... Nguyễn Thái Ngọc Duy Thu, 6 Feb 2014 15:10:36 +0000 (22:10 +0700)

pack-protocol.txt: clarify 'obj-id' in the last ACK after 'done'

It's introduced in 1bd8c8f (git-upload-pack: Support the multi_ack
protocol - 2005-10-28) but probably better documented in the commit
message of 78affc4 (Add multi_ack_detailed capability to
fetch-pack/upload-pack - 2009-10-30).

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

test: rename http fetch and push test filesNguyễn Thái Ngọc Duy Thu, 6 Feb 2014 15:10:34 +0000 (22:10 +0700)

test: rename http fetch and push test files

Make clear which one is for dumb protocol, which one is for smart from
their file name.

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

tests: auto-set LIB_HTTPD_PORT from test nameJeff King Mon, 10 Feb 2014 14:39:48 +0000 (09:39 -0500)

tests: auto-set LIB_HTTPD_PORT from test name

We set the default apache port for each of the httpd tests
to the 4-digit test number of the test script. We want these
to remain unique so that the tests do not conflict with each
other when run in parallel.

Instead of doing it manually in each test script, let's just
set it from the test name at run time. This is simpler, and
is one less thing to be updated when test scripts are
renamed (e.g., when being re-rolled or when conflicting
after being merged with another topic).

Incidentally, this fixes a case where t5537 and t5538 used
the same port number (5537), and could conflict with each
other when run in parallel.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>