git.git
10 years agoMerge branch 'sg/complete-decorate-full-not-long' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:22 +0000 (13:49 -0700)]
Merge branch 'sg/complete-decorate-full-not-long' into maint

The completion for "log --decorate=" parameter value was incorrect.

* sg/complete-decorate-full-not-long:
  completion: fix and update 'git log --decorate=' options

10 years agoMerge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:20 +0000 (13:49 -0700)]
Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint

"filter-branch" corrupted commit log message that ends with an
incomplete line on platforms with some "sed" implementations that
munge such a line.  Work it around by avoiding to use "sed".

* jk/filter-branch-use-of-sed-on-incomplete-line:
  filter-branch: avoid passing commit message through sed

10 years agoMerge branch 'jc/daemon-no-ipv6-for-2.4.1' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:19 +0000 (13:49 -0700)]
Merge branch 'jc/daemon-no-ipv6-for-2.4.1' into maint

"git daemon" fails to build from the source under NO_IPV6
configuration (regression in 2.4).

* jc/daemon-no-ipv6-for-2.4.1:
  daemon: unbreak NO_IPV6 build regression

10 years agoMerge branch 'jk/stash-require-clean-index' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:19 +0000 (13:49 -0700)]
Merge branch 'jk/stash-require-clean-index' into maint

"git stash pop/apply" forgot to make sure that not just the working
tree is clean but also the index is clean. The latter is important
as a stash application can conflict and the index will be used for
conflict resolution.

* jk/stash-require-clean-index:
  stash: require a clean index to apply
  t3903: avoid applying onto dirty index
  t3903: stop hard-coding commit sha1s

10 years agoMerge branch 'jk/git-no-more-argv0-path-munging' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:18 +0000 (13:49 -0700)]
Merge branch 'jk/git-no-more-argv0-path-munging' into maint

We have prepended $GIT_EXEC_PATH and the path "git" is installed in
(typically "/usr/bin") to $PATH when invoking subprograms and hooks
for almost eternity, but the original use case the latter tried to
support was semi-bogus (i.e. install git to /opt/foo/git and run it
without having /opt/foo on $PATH), and more importantly it has
become less and less relevant as Git grew more mainstream (i.e. the
users would _want_ to have it on their $PATH).  Stop prepending the
path in which "git" is installed to users' $PATH, as that would
interfere the command search order people depend on (e.g. they may
not like versions of programs that are unrelated to Git in /usr/bin
and want to override them by having different ones in /usr/local/bin
and have the latter directory earlier in their $PATH).

* jk/git-no-more-argv0-path-munging:
  stop putting argv[0] dirname at front of PATH

10 years agoFifth batch for 2.5 cycle
Junio C Hamano [Tue, 26 May 2015 20:33:35 +0000 (13:33 -0700)]
Fifth batch for 2.5 cycle

Signed-off-by: Junio C Hamano <redacted>
10 years agoMerge branch 'nd/untracked-cache'
Junio C Hamano [Tue, 26 May 2015 20:24:45 +0000 (13:24 -0700)]
Merge branch 'nd/untracked-cache'

Teach the index to optionally remember already seen untracked files
to speed up "git status" in a working tree with tons of cruft.

* nd/untracked-cache: (24 commits)
  git-status.txt: advertisement for untracked cache
  untracked cache: guard and disable on system changes
  mingw32: add uname()
  t7063: tests for untracked cache
  update-index: test the system before enabling untracked cache
  update-index: manually enable or disable untracked cache
  status: enable untracked cache
  untracked-cache: temporarily disable with $GIT_DISABLE_UNTRACKED_CACHE
  untracked cache: mark index dirty if untracked cache is updated
  untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATS
  untracked cache: avoid racy timestamps
  read-cache.c: split racy stat test to a separate function
  untracked cache: invalidate at index addition or removal
  untracked cache: load from UNTR index extension
  untracked cache: save to an index extension
  ewah: add convenient wrapper ewah_serialize_strbuf()
  untracked cache: don't open non-existent .gitignore
  untracked cache: mark what dirs should be recursed/saved
  untracked cache: record/validate dir mtime and reuse cached output
  untracked cache: make a wrapper around {open,read,close}dir()
  ...

10 years agoMerge branch 'rs/plug-leak-in-pack-bitmaps'
Junio C Hamano [Tue, 26 May 2015 20:24:44 +0000 (13:24 -0700)]
Merge branch 'rs/plug-leak-in-pack-bitmaps'

The code to read pack-bitmap wanted to allocate a few hundred
pointers to a structure, but by mistake allocated and leaked memory
enough to hold that many actual structures.  Correct the allocation
size and also have it on stack, as it is small enough.

* rs/plug-leak-in-pack-bitmaps:
  pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps

10 years agoMerge branch 'pt/pull-ff-vs-merge-ff'
Junio C Hamano [Tue, 26 May 2015 20:24:43 +0000 (13:24 -0700)]
Merge branch 'pt/pull-ff-vs-merge-ff'

The pull.ff configuration was supposed to override the merge.ff
configuration, but it didn't.

* pt/pull-ff-vs-merge-ff:
  pull: parse pull.ff as a bool or string
  pull: make pull.ff=true override merge.ff

10 years agoMerge branch 'pt/pull-log-n'
Junio C Hamano [Tue, 26 May 2015 20:24:43 +0000 (13:24 -0700)]
Merge branch 'pt/pull-log-n'

"git pull --log" and "git pull --no-log" worked as expected, but
"git pull --log=20" did not.

* pt/pull-log-n:
  pull: handle --log=<n>

10 years agoMerge branch 'jk/rerere-forget-check-enabled'
Junio C Hamano [Tue, 26 May 2015 20:24:42 +0000 (13:24 -0700)]
Merge branch 'jk/rerere-forget-check-enabled'

"git rerere forget" in a repository without rerere enabled gave a
cryptic error message; it should be a silent no-op instead.

* jk/rerere-forget-check-enabled:
  rerere: exit silently on "forget" when rerere is disabled

10 years agogit-p4: tests: use test-chmtime in place of touch
Luke Diamand [Tue, 19 May 2015 22:23:18 +0000 (23:23 +0100)]
git-p4: tests: use test-chmtime in place of touch

Using "touch" for P4EDITOR means that the tests can be a bit
racy, since git-p4 checks the timestamp has been updated and
fails if the timestamp is not updated.

Use test-chmtime instead, which is designed for this.

Signed-off-by: Luke Diamand <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot4015: separate common setup and per-test expectation
Junio C Hamano [Tue, 26 May 2015 18:43:08 +0000 (11:43 -0700)]
t4015: separate common setup and per-test expectation

The last two tests in the script were to

 - set up color.diff.* slots
 - set up an expectation for a single test
 - run that test and check the result

but split in a wrong way.  It did the first two in the first test
and the third one in the second test.  The latter two belong to each
other.  This matters when you plan to add more of these tests that
share the common coloring.

While at it, make sure we use a color different from old, which is
also red.

Signed-off-by: Junio C Hamano <redacted>
10 years agot4015: modernise style
Junio C Hamano [Tue, 26 May 2015 18:19:52 +0000 (11:19 -0700)]
t4015: modernise style

Move the preparatory steps that create the expected output inside
the test bodies, remove unnecessary blank lines before and after the
test bodies, and drop SP between redirection operator and its target.

Signed-off-by: Junio C Hamano <redacted>
10 years agoMerge branch 'jk/http-backend-deadlock-2.3' into jk/http-backend-deadlock
Junio C Hamano [Tue, 26 May 2015 03:44:42 +0000 (20:44 -0700)]
Merge branch 'jk/http-backend-deadlock-2.3' into jk/http-backend-deadlock

* jk/http-backend-deadlock-2.3:
  http-backend: spool ref negotiation requests to buffer
  t5551: factor out tag creation
  http-backend: fix die recursion with custom handler

10 years agoMerge branch 'jk/http-backend-deadlock-2.2' into jk/http-backend-deadlock-2.3
Junio C Hamano [Tue, 26 May 2015 03:44:04 +0000 (20:44 -0700)]
Merge branch 'jk/http-backend-deadlock-2.2' into jk/http-backend-deadlock-2.3

* jk/http-backend-deadlock-2.2:
  http-backend: spool ref negotiation requests to buffer
  t5551: factor out tag creation
  http-backend: fix die recursion with custom handler

10 years agohttp-backend: spool ref negotiation requests to buffer
Jeff King [Wed, 20 May 2015 07:37:09 +0000 (03:37 -0400)]
http-backend: spool ref negotiation requests to buffer

When http-backend spawns "upload-pack" to do ref
negotiation, it streams the http request body to
upload-pack, who then streams the http response back to the
client as it reads. In theory, git can go full-duplex; the
client can consume our response while it is still sending
the request.  In practice, however, HTTP is a half-duplex
protocol. Even if our client is ready to read and write
simultaneously, we may have other HTTP infrastructure in the
way, including the webserver that spawns our CGI, or any
intermediate proxies.

In at least one documented case[1], this leads to deadlock
when trying a fetch over http. What happens is basically:

  1. Apache proxies the request to the CGI, http-backend.

  2. http-backend gzip-inflates the data and sends
     the result to upload-pack.

  3. upload-pack acts on the data and generates output over
     the pipe back to Apache. Apache isn't reading because
     it's busy writing (step 1).

This works fine most of the time, because the upload-pack
output ends up in a system pipe buffer, and Apache reads
it as soon as it finishes writing. But if both the request
and the response exceed the system pipe buffer size, then we
deadlock (Apache blocks writing to http-backend,
http-backend blocks writing to upload-pack, and upload-pack
blocks writing to Apache).

We need to break the deadlock by spooling either the input
or the output. In this case, it's ideal to spool the input,
because Apache does not start reading either stdout _or_
stderr until we have consumed all of the input. So until we
do so, we cannot even get an error message out to the
client.

The solution is fairly straight-forward: we read the request
body into an in-memory buffer in http-backend, freeing up
Apache, and then feed the data ourselves to upload-pack. But
there are a few important things to note:

  1. We limit the in-memory buffer to prevent an obvious
     denial-of-service attack. This is a new hard limit on
     requests, but it's unlikely to come into play. The
     default value is 10MB, which covers even the ridiculous
     100,000-ref negotation in the included test (that
     actually caps out just over 5MB). But it's configurable
     on the off chance that you don't mind spending some
     extra memory to make even ridiculous requests work.

  2. We must take care only to buffer when we have to. For
     pushes, the incoming packfile may be of arbitrary
     size, and we should connect the input directly to
     receive-pack. There's no deadlock problem here, though,
     because we do not produce any output until the whole
     packfile has been read.

     For upload-pack's initial ref advertisement, we
     similarly do not need to buffer. Even though we may
     generate a lot of output, there is no request body at
     all (i.e., it is a GET, not a POST).

[1] http://article.gmane.org/gmane.comp.version-control.git/269020

Test-adapted-from: Dennis Kaarsemaker <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agostruct ref_lock: convert old_sha1 member to object_id
Michael Haggerty [Mon, 25 May 2015 18:39:22 +0000 (18:39 +0000)]
struct ref_lock: convert old_sha1 member to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agowarn_if_dangling_symref(): convert local variable "junk" to object_id
Michael Haggerty [Mon, 25 May 2015 18:39:21 +0000 (18:39 +0000)]
warn_if_dangling_symref(): convert local variable "junk" to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoeach_ref_fn_adapter(): remove adapter
Michael Haggerty [Mon, 25 May 2015 18:39:20 +0000 (18:39 +0000)]
each_ref_fn_adapter(): remove adapter

All of the callers of the for_each_ref family of functions have now
been rewritten to work with object_ids, so this adapter is no longer
needed.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agorev_list_insert_ref(): remove unneeded arguments
Michael Haggerty [Mon, 25 May 2015 18:39:19 +0000 (18:39 +0000)]
rev_list_insert_ref(): remove unneeded arguments

Now that the function is not being used as an each_ref_sha1_fn, we can
delete the unused arguments in its signature.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agorev_list_insert_ref_oid(): new function, taking an object_oid
Michael Haggerty [Mon, 25 May 2015 18:39:18 +0000 (18:39 +0000)]
rev_list_insert_ref_oid(): new function, taking an object_oid

This function can be used with for_each_ref() without having to be
wrapped.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agomark_complete(): remove unneeded arguments
Michael Haggerty [Mon, 25 May 2015 18:39:17 +0000 (18:39 +0000)]
mark_complete(): remove unneeded arguments

Now that the function is not being used as an each_ref_sha1_fn, we can
delete the unused arguments in its signature.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agomark_complete_oid(): new function, taking an object_oid
Michael Haggerty [Mon, 25 May 2015 18:39:16 +0000 (18:39 +0000)]
mark_complete_oid(): new function, taking an object_oid

This function can be used with for_each_ref() without having to be
wrapped.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoclear_marks(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:15 +0000 (18:39 +0000)]
clear_marks(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agomark_complete(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:14 +0000 (18:39 +0000)]
mark_complete(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agosend_ref(): convert local variable "peeled" to object_id
Michael Haggerty [Mon, 25 May 2015 18:39:13 +0000 (18:39 +0000)]
send_ref(): convert local variable "peeled" to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoupload-pack: rewrite functions to take object_id arguments
Michael Haggerty [Mon, 25 May 2015 18:39:12 +0000 (18:39 +0000)]
upload-pack: rewrite functions to take object_id arguments

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agofind_symref(): convert local variable "unused" to object_id
Michael Haggerty [Mon, 25 May 2015 18:39:11 +0000 (18:39 +0000)]
find_symref(): convert local variable "unused" to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agofind_symref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:10 +0000 (18:39 +0000)]
find_symref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agowrite_one_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:09 +0000 (18:39 +0000)]
write_one_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agowrite_refs_to_temp_dir(): convert local variable sha1 to object_id
Michael Haggerty [Mon, 25 May 2015 18:39:08 +0000 (18:39 +0000)]
write_refs_to_temp_dir(): convert local variable sha1 to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agosubmodule: rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:07 +0000 (18:39 +0000)]
submodule: rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoshallow: rewrite functions to take object_id arguments
Michael Haggerty [Mon, 25 May 2015 18:39:06 +0000 (18:39 +0000)]
shallow: rewrite functions to take object_id arguments

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agohandle_one_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:05 +0000 (18:39 +0000)]
handle_one_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoadd_info_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:04 +0000 (18:39 +0000)]
add_info_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agohandle_one_reflog(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:03 +0000 (18:39 +0000)]
handle_one_reflog(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoregister_replace_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:02 +0000 (18:39 +0000)]
register_replace_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoremote: rewrite functions to take object_id arguments
Michael Haggerty [Mon, 25 May 2015 18:39:01 +0000 (18:39 +0000)]
remote: rewrite functions to take object_id arguments

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoadd_one_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:39:00 +0000 (18:39 +0000)]
add_one_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agostring_list_add_one_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:59 +0000 (18:38 +0000)]
string_list_add_one_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoadd_ref_decoration(): convert local variable original_sha1 to object_id
Michael Haggerty [Mon, 25 May 2015 18:38:58 +0000 (18:38 +0000)]
add_ref_decoration(): convert local variable original_sha1 to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoadd_ref_decoration(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:57 +0000 (18:38 +0000)]
add_ref_decoration(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoshow_head_ref(): convert local variable "unused" to object_id
Michael Haggerty [Mon, 25 May 2015 18:38:56 +0000 (18:38 +0000)]
show_head_ref(): convert local variable "unused" to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agohttp-backend: rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:55 +0000 (18:38 +0000)]
http-backend: rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoappend_similar_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:54 +0000 (18:38 +0000)]
append_similar_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/show-ref: rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:53 +0000 (18:38 +0000)]
builtin/show-ref: rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoshow_ref(): convert local variable peeled to object_id
Michael Haggerty [Mon, 25 May 2015 18:38:52 +0000 (18:38 +0000)]
show_ref(): convert local variable peeled to object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/show-ref: rewrite to use object_id
Michael Haggerty [Mon, 25 May 2015 18:38:51 +0000 (18:38 +0000)]
builtin/show-ref: rewrite to use object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agofsck: change functions to use object_id
Michael Haggerty [Mon, 25 May 2015 18:38:50 +0000 (18:38 +0000)]
fsck: change functions to use object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocmd_show_branch(): fix error message
Michael Haggerty [Mon, 25 May 2015 18:38:49 +0000 (18:38 +0000)]
cmd_show_branch(): fix error message

We need to convert the SHA-1 to hexadecimal before printing it.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/show-branch: rewrite functions to work with object_id
Michael Haggerty [Mon, 25 May 2015 18:38:48 +0000 (18:38 +0000)]
builtin/show-branch: rewrite functions to work with object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoappend_one_rev(): rewrite to work with object_id
Michael Haggerty [Mon, 25 May 2015 18:38:47 +0000 (18:38 +0000)]
append_one_rev(): rewrite to work with object_id

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/show-branch: rewrite functions to take object_id arguments
Michael Haggerty [Mon, 25 May 2015 18:38:46 +0000 (18:38 +0000)]
builtin/show-branch: rewrite functions to take object_id arguments

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoappend_matching_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:45 +0000 (18:38 +0000)]
append_matching_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoshow_reference(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:44 +0000 (18:38 +0000)]
show_reference(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/remote: rewrite functions to take object_id arguments
Michael Haggerty [Mon, 25 May 2015 18:38:43 +0000 (18:38 +0000)]
builtin/remote: rewrite functions to take object_id arguments

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoadd_branch_for_removal(): don't set "util" field of string_list entries
Michael Haggerty [Mon, 25 May 2015 18:38:42 +0000 (18:38 +0000)]
add_branch_for_removal(): don't set "util" field of string_list entries

They were never used.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoadd_branch_for_removal(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:41 +0000 (18:38 +0000)]
add_branch_for_removal(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/reflog: rewrite ref functions to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:40 +0000 (18:38 +0000)]
builtin/reflog: rewrite ref functions to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoshow_ref_cb(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:39 +0000 (18:38 +0000)]
show_ref_cb(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/pack-objects: rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:38 +0000 (18:38 +0000)]
builtin/pack-objects: rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoname_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:37 +0000 (18:38 +0000)]
name_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agograb_single_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:36 +0000 (18:38 +0000)]
grab_single_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/fetch: rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:35 +0000 (18:38 +0000)]
builtin/fetch: rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoget_name(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:34 +0000 (18:38 +0000)]
get_name(): rewrite to take an object_id argument

Rewrite to take an object_id argument and convert the local variable
"peeled" object_id.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoadd_pending_uninteresting_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:33 +0000 (18:38 +0000)]
add_pending_uninteresting_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoappend_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:32 +0000 (18:38 +0000)]
append_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoregister_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:31 +0000 (18:38 +0000)]
register_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agohandle_one_ref(): rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:30 +0000 (18:38 +0000)]
handle_one_ref(): rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/rev-parse: rewrite to take an object_id argument
Michael Haggerty [Mon, 25 May 2015 18:38:29 +0000 (18:38 +0000)]
builtin/rev-parse: rewrite to take an object_id argument

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoeach_ref_fn: change to take an object_id parameter
Michael Haggerty [Mon, 25 May 2015 18:38:28 +0000 (18:38 +0000)]
each_ref_fn: change to take an object_id parameter

Change typedef each_ref_fn to take a "const struct object_id *oid"
parameter instead of "const unsigned char *sha1".

To aid this transition, implement an adapter that can be used to wrap
old-style functions matching the old typedef, which is now called
"each_ref_sha1_fn"), and make such functions callable via the new
interface. This requires the old function and its cb_data to be
wrapped in a "struct each_ref_fn_sha1_adapter", and that object to be
used as the cb_data for an adapter function, each_ref_fn_adapter().

This is an enormous diff, but most of it consists of simple,
mechanical changes to the sites that call any of the "for_each_ref"
family of functions. Subsequent to this change, the call sites can be
rewritten one by one to use the new interface.

Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agorefs: convert struct ref_entry to use struct object_id
brian m. carlson [Mon, 25 May 2015 18:38:27 +0000 (18:38 +0000)]
refs: convert struct ref_entry to use struct object_id

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agogit-p4: fix handling of multi-word P4EDITOR
Luke Diamand [Tue, 19 May 2015 22:23:17 +0000 (23:23 +0100)]
git-p4: fix handling of multi-word P4EDITOR

This teaches git-p4 to pass the P4EDITOR variable to the
shell for expansion, so that any command-line arguments are
correctly handled. Without this, git-p4 can only launch the
editor if P4EDITOR is solely the path to the binary, without
any arguments.

This also adjusts t9805, which relied on the previous behaviour.

Suggested-by: Jonathan Nieder <redacted>
Signed-off-by: Luke Diamand <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agogit-p4: add failing test for P4EDITOR handling
Luke Diamand [Tue, 19 May 2015 22:23:16 +0000 (23:23 +0100)]
git-p4: add failing test for P4EDITOR handling

Add test case that git-p4 handles a setting of P4EDITOR
that takes arguments, e.g. "gvim -f". This currently fails.

Signed-off-by: Luke Diamand <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoupload-pack: optionally allow fetching reachable sha1
Fredrik Medley [Thu, 21 May 2015 20:23:39 +0000 (22:23 +0200)]
upload-pack: optionally allow fetching reachable sha1

With uploadpack.allowReachableSHA1InWant configuration option set on the
server side, "git fetch" can make a request with a "want" line that names
an object that has not been advertised (likely to have been obtained out
of band or from a submodule pointer). Only objects reachable from the
branch tips, i.e. the union of advertised branches and branches hidden by
transfer.hideRefs, will be processed. Note that there is an associated
cost of having to walk back the history to check the reachability.

This feature can be used when obtaining the content of a certain commit,
for which the sha1 is known, without the need of cloning the whole
repository, especially if a shallow fetch is used. Useful cases are e.g.
repositories containing large files in the history, fetching only the
needed data for a submodule checkout, when sharing a sha1 without telling
which exact branch it belongs to and in Gerrit, if you think in terms of
commits instead of change numbers. (The Gerrit case has already been
solved through allowTipSHA1InWant as every Gerrit change has a ref.)

Signed-off-by: Fredrik Medley <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoupload-pack: prepare to extend allow-tip-sha1-in-want
Fredrik Medley [Thu, 21 May 2015 20:23:38 +0000 (22:23 +0200)]
upload-pack: prepare to extend allow-tip-sha1-in-want

To allow future extensions, e.g. allowing non-tip sha1, replace the
boolean allow_tip_sha1_in_want variable with the flag-style
allow_request_with_bare_object_name variable.

Signed-off-by: Fredrik Medley <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocommit-slab: introduce slabname##_peek() function
Junio C Hamano [Thu, 14 May 2015 22:25:52 +0000 (15:25 -0700)]
commit-slab: introduce slabname##_peek() function

There is no API to ask "Does this commit have associated data in
slab?".  If an application wants to (1) parse just a few commits at
the beginning of a process, (2) store data for only these commits,
and then (3) start processing many commits, taking into account the
data stored (for a few of them) in the slab, the application would
use slabname##_at() to allocate a space to store data in (2), but
there is no API other than slabname##_at() to use in step (3).  This
allocates and wastes new space for these commits the caller is only
interested in checking if they have data stored in step (2).

Introduce slabname##_peek(), which is similar to slabname##_at() but
returns NULL when there is no data already associated to it in such
a use case.

Helped-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoFourth batch for 2.5 cycle
Junio C Hamano [Fri, 22 May 2015 19:53:21 +0000 (12:53 -0700)]
Fourth batch for 2.5 cycle

Signed-off-by: Junio C Hamano <redacted>
10 years agoMerge branch 'ps/doc-packfile-vs-pack-file'
Junio C Hamano [Fri, 22 May 2015 19:42:00 +0000 (12:42 -0700)]
Merge branch 'ps/doc-packfile-vs-pack-file'

Doc consistency updates.

* ps/doc-packfile-vs-pack-file:
  doc: fix inconsistent spelling of "packfile"
  pack-protocol.txt: fix insconsistent spelling of "packfile"
  git-unpack-objects.txt: fix inconsistent spelling of "packfile"
  git-verify-pack.txt: fix inconsistent spelling of "packfile"

10 years agoMerge branch 'sb/t1020-cleanup'
Junio C Hamano [Fri, 22 May 2015 19:41:59 +0000 (12:41 -0700)]
Merge branch 'sb/t1020-cleanup'

There was a commented-out (instead of being marked to expect
failure) test that documented a breakage that was fixed since the
test was written; turn it into a proper test.

* sb/t1020-cleanup:
  subdirectory tests: code cleanup, uncomment test

10 years agoMerge branch 'lm/squelch-bg-progress'
Junio C Hamano [Fri, 22 May 2015 19:41:58 +0000 (12:41 -0700)]
Merge branch 'lm/squelch-bg-progress'

The controlling tty-based heuristics to squelch progress output did
not consider that the process may not be talking to a tty at all
(e.g. sending the progress to sideband #2).  This is a finishing
touch to a topic that is already in 'master'.

* lm/squelch-bg-progress:
  progress: treat "no terminal" as being in the foreground

10 years agoMerge branch 'jc/ignore-epipe-in-filter'
Junio C Hamano [Fri, 22 May 2015 19:41:57 +0000 (12:41 -0700)]
Merge branch 'jc/ignore-epipe-in-filter'

Filter scripts were run with SIGPIPE disabled on the Git side,
expecting that they may not read what Git feeds them to filter.
We however treated a filter that does not read its input fully
before exiting as an error.

This changes semantics, but arguably in a good way.  If a filter
can produce its output without consuming its input using whatever
magic, we now let it do so, instead of diagnosing it as a
programming error.

* jc/ignore-epipe-in-filter:
  filter_buffer_or_fd(): ignore EPIPE
  copy.c: make copy_fd() report its status silently

10 years agoMerge branch 'mh/clone-verbosity-fix'
Junio C Hamano [Fri, 22 May 2015 19:41:56 +0000 (12:41 -0700)]
Merge branch 'mh/clone-verbosity-fix'

Git 2.4 broke setting verbosity and progress levels on "git clone"
with native transports.

* mh/clone-verbosity-fix:
  clone: call transport_set_verbosity before anything else on the newly created transport

10 years agoMerge branch 'pt/pull-tags-error-diag'
Junio C Hamano [Fri, 22 May 2015 19:41:56 +0000 (12:41 -0700)]
Merge branch 'pt/pull-tags-error-diag'

There was a dead code that used to handle "git pull --tags" and
show special-cased error message, which was made irrelevant when
the semantics of the option changed back in Git 1.9 days.

* pt/pull-tags-error-diag:
  pull: remove --tags error in no merge candidates case

10 years agoMerge branch 'mh/lockfile-retry'
Junio C Hamano [Fri, 22 May 2015 19:41:55 +0000 (12:41 -0700)]
Merge branch 'mh/lockfile-retry'

Instead of dying immediately upon failing to obtain a lock, retry
after a short while with backoff.

* mh/lockfile-retry:
  lock_packed_refs(): allow retries when acquiring the packed-refs lock
  lockfile: allow file locking to be retried with a timeout

10 years agoMerge branch 'jk/add-e-kill-editor'
Junio C Hamano [Fri, 22 May 2015 19:41:55 +0000 (12:41 -0700)]
Merge branch 'jk/add-e-kill-editor'

"git add -e" did not allow the user to abort the operation by
killing the editor.

* jk/add-e-kill-editor:
  add: check return value of launch_editor

10 years agoMerge branch 'sg/completion-config'
Junio C Hamano [Fri, 22 May 2015 19:41:53 +0000 (12:41 -0700)]
Merge branch 'sg/completion-config'

Code clean-up for completion script (in contrib/).

* sg/completion-config:
  completion: simplify query for config variables
  completion: add a helper function to get config variables

10 years agoMerge branch 'mh/ref-directory-file'
Junio C Hamano [Fri, 22 May 2015 19:41:53 +0000 (12:41 -0700)]
Merge branch 'mh/ref-directory-file'

The ref API did not handle cases where 'refs/heads/xyzzy/frotz' is
removed at the same time as 'refs/heads/xyzzy' is added (or vice
versa) very well.

* mh/ref-directory-file:
  reflog_expire(): integrate lock_ref_sha1_basic() errors into ours
  ref_transaction_commit(): delete extra "the" from error message
  ref_transaction_commit(): provide better error messages
  rename_ref(): integrate lock_ref_sha1_basic() errors into ours
  lock_ref_sha1_basic(): improve diagnostics for ref D/F conflicts
  lock_ref_sha1_basic(): report errors via a "struct strbuf *err"
  verify_refname_available(): report errors via a "struct strbuf *err"
  verify_refname_available(): rename function
  refs: check for D/F conflicts among refs created in a transaction
  ref_transaction_commit(): use a string_list for detecting duplicates
  is_refname_available(): use dirname in first loop
  struct nonmatching_ref_data: store a refname instead of a ref_entry
  report_refname_conflict(): inline function
  entry_matches(): inline function
  is_refname_available(): convert local variable "dirname" to strbuf
  is_refname_available(): avoid shadowing "dir" variable
  is_refname_available(): revamp the comments
  t1404: new tests of ref D/F conflicts within transactions

10 years agoMerge branch 'mh/write-refs-sooner-2.4'
Junio C Hamano [Fri, 22 May 2015 19:41:52 +0000 (12:41 -0700)]
Merge branch 'mh/write-refs-sooner-2.4'

Multi-ref transaction support we merged a few releases ago
unnecessarily kept many file descriptors open, risking to fail with
resource exhaustion.  This is for 2.4.x track.

* mh/write-refs-sooner-2.4:
  ref_transaction_commit(): fix atomicity and avoid fd exhaustion
  ref_transaction_commit(): remove the local flags variable
  ref_transaction_commit(): inline call to write_ref_sha1()
  rename_ref(): inline calls to write_ref_sha1() from this function
  commit_ref_update(): new function, extracted from write_ref_sha1()
  write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
  t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
  update-ref: test handling large transactions properly
  ref_transaction_commit(): fix atomicity and avoid fd exhaustion
  ref_transaction_commit(): remove the local flags variable
  ref_transaction_commit(): inline call to write_ref_sha1()
  rename_ref(): inline calls to write_ref_sha1() from this function
  commit_ref_update(): new function, extracted from write_ref_sha1()
  write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
  t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
  update-ref: test handling large transactions properly

10 years agoMerge branch 'mg/log-decorate-HEAD'
Junio C Hamano [Fri, 22 May 2015 19:41:51 +0000 (12:41 -0700)]
Merge branch 'mg/log-decorate-HEAD'

The "log --decorate" enhancement in Git 2.4 that shows the commit
at the tip of the current branch e.g. "HEAD -> master", did not
work with --decorate=full.

* mg/log-decorate-HEAD:
  log: do not shorten decoration names too early
  log: decorate HEAD with branch name under --decorate=full, too

10 years agoMerge branch 'jk/asciidoc-markup-fix'
Junio C Hamano [Fri, 22 May 2015 19:41:50 +0000 (12:41 -0700)]
Merge branch 'jk/asciidoc-markup-fix'

Various documentation mark-up fixes to make the output more
consistent in general and also make AsciiDoctor (an alternative
formatter) happier.

* jk/asciidoc-markup-fix:
  doc: convert AsciiDoc {?foo} to ifdef::foo[]
  doc: put example URLs and emails inside literal backticks
  doc: drop backslash quoting of some curly braces
  doc: convert \--option to --option
  doc/add: reformat `--edit` option
  doc: fix length of underlined section-title
  doc: fix hanging "+"-continuation
  doc: fix unquoted use of "{type}"
  doc: fix misrendering due to `single quote'

10 years agoMerge branch 'jk/stripspace-asciidoctor-fix'
Junio C Hamano [Fri, 22 May 2015 19:41:49 +0000 (12:41 -0700)]
Merge branch 'jk/stripspace-asciidoctor-fix'

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* jk/stripspace-asciidoctor-fix:
  doc: fix unmatched code fences in git-stripspace

10 years agoMerge branch 'ja/tutorial-asciidoctor-fix'
Junio C Hamano [Fri, 22 May 2015 19:41:48 +0000 (12:41 -0700)]
Merge branch 'ja/tutorial-asciidoctor-fix'

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* ja/tutorial-asciidoctor-fix:
  doc: fix unmatched code fences

10 years agoMerge branch 'sg/help-subcommands'
Junio C Hamano [Fri, 22 May 2015 19:41:47 +0000 (12:41 -0700)]
Merge branch 'sg/help-subcommands'

A preparatory clean-up step.

* sg/help-subcommands:
  command-list.txt: fix whitespace inconsistency

10 years agoMerge branch 'ps/bundle-verify-arg'
Junio C Hamano [Fri, 22 May 2015 19:41:46 +0000 (12:41 -0700)]
Merge branch 'ps/bundle-verify-arg'

"git bundle verify" did not diagnose extra parameters on the
command line.

* ps/bundle-verify-arg:
  bundle: verify arguments more strictly

10 years agoMerge branch 'ls/http-ssl-cipher-list'
Junio C Hamano [Fri, 22 May 2015 19:41:45 +0000 (12:41 -0700)]
Merge branch 'ls/http-ssl-cipher-list'

Introduce http.<url>.SSLCipherList configuration variable to tweak
the list of cipher suite to be used with libcURL when talking with
https:// sites.

* ls/http-ssl-cipher-list:
  http: add support for specifying an SSL cipher list

10 years agoMerge branch 'dl/subtree-avoid-tricky-echo'
Junio C Hamano [Fri, 22 May 2015 19:41:45 +0000 (12:41 -0700)]
Merge branch 'dl/subtree-avoid-tricky-echo'

"git subtree" script (in contrib/) used "echo -n" to produce
progress messages in a non-portable way.

* dl/subtree-avoid-tricky-echo:
  contrib/subtree: portability fix for string printing

10 years agoMerge branch 'jk/skip-http-tests-under-no-curl'
Junio C Hamano [Fri, 22 May 2015 19:41:44 +0000 (12:41 -0700)]
Merge branch 'jk/skip-http-tests-under-no-curl'

Test clean-up.

* jk/skip-http-tests-under-no-curl:
  tests: skip dav http-push tests under NO_EXPAT=NoThanks
  t/lib-httpd.sh: skip tests if NO_CURL is defined

10 years agoMerge branch 'dl/subtree-push-no-squash'
Junio C Hamano [Fri, 22 May 2015 19:41:43 +0000 (12:41 -0700)]
Merge branch 'dl/subtree-push-no-squash'

"git subtree" script (in contrib/) does not have --squash option
when pushing, but the documentation and help text pretended as if
it did.

* dl/subtree-push-no-squash:
  contrib/subtree: there's no push --squash

git clone https://git.99rst.org/PROJECT