]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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'

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 years agoMerge branch 'sg/completion-omit-credential-helpers'
Junio C Hamano [Fri, 22 May 2015 19:41:42 +0000 (12:41 -0700)] 
Merge branch 'sg/completion-omit-credential-helpers'

The Git subcommand completion (in contrib/) listed credential
helpers among candidates, which is not something the end user would
invoke interatively.

* sg/completion-omit-credential-helpers:
  completion: remove credential helpers from porcelain commands

9 years agoMerge branch 'dl/branch-error-message'
Junio C Hamano [Fri, 22 May 2015 19:41:41 +0000 (12:41 -0700)] 
Merge branch 'dl/branch-error-message'

Error messages from "git branch" called remote-tracking branches as
"remote branches".

* dl/branch-error-message:
  branch: do not call a "remote-tracking branch" a "remote branch"

9 years agofilter_buffer_or_fd(): ignore EPIPE
Junio C Hamano [Tue, 19 May 2015 18:08:23 +0000 (11:08 -0700)] 
filter_buffer_or_fd(): ignore EPIPE

We are explicitly ignoring SIGPIPE, as we fully expect that the
filter program may not read our output fully.  Ignore EPIPE that
may come from writing to it as well.

A new test was stolen from Jeff's suggestion.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocopy.c: make copy_fd() report its status silently
Junio C Hamano [Tue, 19 May 2015 17:55:16 +0000 (10:55 -0700)] 
copy.c: make copy_fd() report its status silently

When copy_fd() function encounters errors, it emits error messages
itself, which makes it impossible for callers to take responsibility
for reporting errors, especially when they want to ignore certain
errors.

Move the error reporting to its callers in preparation.

 - copy_file() and copy_file_with_time() by indirection get their
   own calls to error().

 - hold_lock_file_for_append(), when told to die on error, used to
   exit(128) relying on the error message from copy_fd(), but now it
   does its own die() instead.  Note that the callers that do not
   pass LOCK_DIE_ON_ERROR need to be adjusted for this change, but
   fortunately there is none ;-)

 - filter_buffer_or_fd() has its own error() already, in addition to
   the message from copy_fd(), so this will change the output but
   arguably in a better way.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoThird batch for 2.5 cycle
Junio C Hamano [Tue, 19 May 2015 20:24:08 +0000 (13:24 -0700)] 
Third batch for 2.5 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'sb/ref-lock-lose-lock-fd'
Junio C Hamano [Tue, 19 May 2015 20:17:59 +0000 (13:17 -0700)] 
Merge branch 'sb/ref-lock-lose-lock-fd'

The refs API uses ref_lock struct which had its own "int fd", even
though the same file descriptor was in the lock struct it contains.
Clean-up the code to lose this redundant field.

* sb/ref-lock-lose-lock-fd:
  refs.c: remove lock_fd from struct ref_lock

9 years agoMerge branch 'kn/cat-file-literally'
Junio C Hamano [Tue, 19 May 2015 20:17:58 +0000 (13:17 -0700)] 
Merge branch 'kn/cat-file-literally'

Add the "--allow-unknown-type" option to "cat-file" to allow
inspecting loose objects of an experimental or a broken type.

* kn/cat-file-literally:
  t1006: add tests for git cat-file --allow-unknown-type
  cat-file: teach cat-file a '--allow-unknown-type' option
  cat-file: make the options mutually exclusive
  sha1_file: support reading from a loose object of unknown type

9 years agoMerge branch 'nd/dwim-wildcards-as-pathspecs'
Junio C Hamano [Tue, 19 May 2015 20:17:57 +0000 (13:17 -0700)] 
Merge branch 'nd/dwim-wildcards-as-pathspecs'

A heuristic to help the "git <cmd> <revs> <pathspec>" command line
convention to catch mistyped paths is to make sure all the non-rev
parameters in the later part of the command line are names of the
files in the working tree, but that means "git grep $str -- \*.c"
must always be disambiguated with "--", because nobody sane will
create a file whose name literally is asterisk-dot-see.  Loosen the
heuristic to declare that with a wildcard string the user likely
meant to give us a pathspec.

* nd/dwim-wildcards-as-pathspecs:
  pathspec: avoid the need of "--" when wildcard is used

9 years agoMerge branch 'jc/merge'
Junio C Hamano [Tue, 19 May 2015 20:17:57 +0000 (13:17 -0700)] 
Merge branch 'jc/merge'

"git merge FETCH_HEAD" learned that the previous "git fetch" could
be to create an Octopus merge, i.e. recording multiple branches
that are not marked as "not-for-merge"; this allows us to lose an
old style invocation "git merge <msg> HEAD $commits..." in the
implementation of "git pull" script; the old style syntax can now
be deprecated.

* jc/merge:
  merge: deprecate 'git merge <message> HEAD <commit>' syntax
  merge: handle FETCH_HEAD internally
  merge: decide if we auto-generate the message early in collect_parents()
  merge: make collect_parents() auto-generate the merge message
  merge: extract prepare_merge_message() logic out
  merge: narrow scope of merge_names
  merge: split reduce_parents() out of collect_parents()
  merge: clarify collect_parents() logic
  merge: small leakfix and code simplification
  merge: do not check argc to determine number of remote heads
  merge: clarify "pulling into void" special case
  t5520: test pulling an octopus into an unborn branch
  t5520: style fixes
  merge: simplify code flow
  merge: test the top-level merge driver

9 years agoMerge branch 'ph/rebase-i-redo'
Junio C Hamano [Tue, 19 May 2015 20:17:56 +0000 (13:17 -0700)] 
Merge branch 'ph/rebase-i-redo'

"git rebase -i" moved the "current" command from "todo" to "done" a
bit too prematurely, losing a step when a "pick" did not even start.

* ph/rebase-i-redo:
  rebase -i: redo tasks that die during cherry-pick

9 years agoMerge branch 'jc/test-prereq-validate'
Junio C Hamano [Tue, 19 May 2015 20:17:55 +0000 (13:17 -0700)] 
Merge branch 'jc/test-prereq-validate'

Help us to find broken test script that splits the body part of the
test by mistaken use of wrong kind of quotes.

* jc/test-prereq-validate:
  test: validate prerequistes syntax

9 years agoMerge branch 'bc/connect-plink'
Junio C Hamano [Tue, 19 May 2015 20:17:54 +0000 (13:17 -0700)] 
Merge branch 'bc/connect-plink'

The connection initiation code for "ssh" transport tried to absorb
differences between the stock "ssh" and Putty-supplied "plink" and
its derivatives, but the logic to tell that we are using "plink"
variants were too loose and falsely triggered when "plink" appeared
anywhere in the path (e.g. "/home/me/bin/uplink/ssh").

* bc/connect-plink:
  connect: improve check for plink to reduce false positives
  t5601: fix quotation error leading to skipped tests
  connect: simplify SSH connection code path

9 years agoMerge branch 'jk/test-chain-lint'
Junio C Hamano [Tue, 19 May 2015 20:17:54 +0000 (13:17 -0700)] 
Merge branch 'jk/test-chain-lint'

Developer support to automatically detect broken &&-chain in the
test scripts is now turned on by default.

* jk/test-chain-lint:
  test-lib: turn on GIT_TEST_CHAIN_LINT by default
  t7502-commit.sh: fix a broken and-chain

9 years agoMerge branch 'fg/document-commit-message-stripping'
Junio C Hamano [Tue, 19 May 2015 20:17:53 +0000 (13:17 -0700)] 
Merge branch 'fg/document-commit-message-stripping'

* fg/document-commit-message-stripping:
  Documentation: clarify how "git commit" cleans up the edited log message

9 years agoMerge branch 'jk/stash-require-clean-index'
Junio C Hamano [Tue, 19 May 2015 20:17:52 +0000 (13:17 -0700)] 
Merge branch 'jk/stash-require-clean-index'

"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

9 years agoMerge branch 'jk/git-no-more-argv0-path-munging'
Junio C Hamano [Tue, 19 May 2015 20:17:52 +0000 (13:17 -0700)] 
Merge branch 'jk/git-no-more-argv0-path-munging'

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

9 years agoMerge branch 'jc/gitignore-precedence'
Junio C Hamano [Tue, 19 May 2015 20:17:50 +0000 (13:17 -0700)] 
Merge branch 'jc/gitignore-precedence'

core.excludesfile (defaulting to $XDG_HOME/git/ignore) is supposed
to be overridden by repository-specific .git/info/exclude file, but
the order was swapped from the beginning. This belatedly fixes it.

* jc/gitignore-precedence:
  ignore: info/exclude should trump core.excludesfile

9 years agoMerge branch 'nd/diff-i-t-a'
Junio C Hamano [Tue, 19 May 2015 20:17:49 +0000 (13:17 -0700)] 
Merge branch 'nd/diff-i-t-a'

After "git add -N", the path appeared in output of "git diff HEAD"
and "git diff --cached HEAD", leading "git status" to classify it
as "Changes to be committed".  Such a path, however, is not yet to
be scheduled to be committed.  "git diff" showed the change to the
path as modification, not as a "new file", in the header of its
output.

Treat such paths as "yet to be added to the index but Git already
know about them"; "git diff HEAD" and "git diff --cached HEAD"
should not talk about them, and "git diff" should show them as new
files yet to be added to the index.

* nd/diff-i-t-a:
  diff-lib.c: adjust position of i-t-a entries in diff

9 years agoclone: call transport_set_verbosity before anything else on the newly created transport
Mike Hommey [Tue, 12 May 2015 04:30:16 +0000 (13:30 +0900)] 
clone: call transport_set_verbosity before anything else on the newly created transport

Commit 2879bc3 made the progress and verbosity options sent to remote helper
earlier than they previously were. But nothing else after that would send
updates if the value is changed later on with transport_set_verbosity.

While for fetch and push, transport_set_verbosity is the first thing that
is done after creating the transport, it was not the case for clone. So
commit 2879bc3 broke changing progress and verbosity for clone, for urls
requiring a remote helper only (so, not git:// urls, for instance).

Moving transport_set_verbosity to just after the transport is created
works around the issue.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolock_packed_refs(): allow retries when acquiring the packed-refs lock
Michael Haggerty [Mon, 11 May 2015 10:35:26 +0000 (12:35 +0200)] 
lock_packed_refs(): allow retries when acquiring the packed-refs lock

Currently, there is only one attempt to acquire any lockfile, and if
the lock is held by another process, the locking attempt fails
immediately.

This is not such a limitation for loose reference files. First, they
don't take long to rewrite. Second, most reference updates have a
known "old" value, so if another process is updating a reference at
the same moment that we are trying to lock it, then probably the
expected "old" value will not longer be valid, and the update will
fail anyway.

But these arguments do not hold for packed-refs:

* The packed-refs file can be large and take significant time to
  rewrite.

* Many references are stored in a single packed-refs file, so it could
  be that the other process was changing a different reference than
  the one that we are interested in.

Therefore, it is much more likely for there to be spurious lock
conflicts in connection to the packed-refs file, resulting in
unnecessary command failures.

So, if the first attempt to lock the packed-refs file fails, continue
retrying for a configurable length of time before giving up. The
default timeout is 1 second.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: allow file locking to be retried with a timeout
Michael Haggerty [Mon, 11 May 2015 10:35:25 +0000 (12:35 +0200)] 
lockfile: allow file locking to be retried with a timeout

Currently, there is only one attempt to lock a file. If it fails, the
whole operation fails.

But it might sometimes be advantageous to try acquiring a file lock a
few times before giving up. So add a new function,
hold_lock_file_for_update_timeout(), that allows a timeout to be
specified. Make hold_lock_file_for_update() a thin wrapper around the
new function.

If timeout_ms is positive, then retry for at least that many
milliseconds to acquire the lock. On each failed attempt, use select()
to wait for a backoff time that increases quadratically (capped at 1
second) and has a random component to prevent two processes from
getting synchronized. If timeout_ms is negative, retry indefinitely.

In a moment we will switch to using the new function when locking
packed-refs.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopull: remove --tags error in no merge candidates case
Paul Tan [Wed, 13 May 2015 10:06:47 +0000 (18:06 +0800)] 
pull: remove --tags error in no merge candidates case

Since 441ed41 ("git pull --tags": error out with a better message.,
2007-12-28), git pull --tags would print a different error message if
git-fetch did not return any merge candidates:

   It doesn't make sense to pull all tags; you probably meant:
        git fetch --tags

This is because at that time, git-fetch --tags would override any
configured refspecs, and thus there would be no merge candidates. The
error message was thus introduced to prevent confusion.

However, since c5a84e9 (fetch --tags: fetch tags *in addition to*
other stuff, 2013-10-30), git fetch --tags would fetch tags in addition
to any configured refspecs. Hence, if any no merge candidates situation
occurs, it is not because --tags was set. As such, this special error
message is now irrelevant.

To prevent confusion, remove this error message.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: convert AsciiDoc {?foo} to ifdef::foo[]
Jeff King [Thu, 14 May 2015 04:34:48 +0000 (00:34 -0400)] 
doc: convert AsciiDoc {?foo} to ifdef::foo[]

The former seems to just be syntactic sugar for the latter.
And as it's sugar that AsciiDoctor doesn't understand, it
would be nice to avoid it. Since there are only two spots,
and the resulting source is not significantly harder to
read, it's worth doing.

Note that this does slightly affect the generated HTML (it
has an extra newline), but the rendered result for both HTML
and docbook should be the same (since the newline is not
syntactically significant there).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with 2.4.1
Junio C Hamano [Wed, 13 May 2015 21:34:46 +0000 (14:34 -0700)] 
Sync with 2.4.1

* maint:
  Git 2.4.1

9 years agoGit 2.4.1 v2.4.1
Junio C Hamano [Wed, 13 May 2015 21:11:43 +0000 (14:11 -0700)] 
Git 2.4.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'sb/line-log-plug-pairdiff-leak' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:56 +0000 (14:05 -0700)] 
Merge branch 'sb/line-log-plug-pairdiff-leak' into maint

* sb/line-log-plug-pairdiff-leak:
  line-log.c: fix a memleak

9 years agoMerge branch 'sb/test-bitmap-free-at-end' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:55 +0000 (14:05 -0700)] 
Merge branch 'sb/test-bitmap-free-at-end' into maint

* sb/test-bitmap-free-at-end:
  pack-bitmap.c: fix a memleak

9 years agoMerge branch 'nd/t1509-chroot-test' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:55 +0000 (14:05 -0700)] 
Merge branch 'nd/t1509-chroot-test' into maint

Correct test bitrot.

* nd/t1509-chroot-test:
  t1509: update prepare script to be able to run t1509 in chroot again

9 years agoMerge branch 'jk/type-from-string-gently' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:54 +0000 (14:05 -0700)] 
Merge branch 'jk/type-from-string-gently' into maint

"git cat-file bl $blob" failed to barf even though there is no
object type that is "bl".

* jk/type-from-string-gently:
  type_from_string_gently: make sure length matches

9 years agoMerge branch 'ep/fix-test-lib-functions-report' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:52 +0000 (14:05 -0700)] 
Merge branch 'ep/fix-test-lib-functions-report' into maint

* ep/fix-test-lib-functions-report:
  test-lib-functions.sh: fix the second argument to some helper functions

9 years agoMerge branch 'cn/bom-in-gitignore' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:51 +0000 (14:05 -0700)] 
Merge branch 'cn/bom-in-gitignore' into maint

Teach the codepaths that read .gitignore and .gitattributes files
that these files encoded in UTF-8 may have UTF-8 BOM marker at the
beginning; this makes it in line with what we do for configuration
files already.

* cn/bom-in-gitignore:
  attr: skip UTF8 BOM at the beginning of the input file
  config: use utf8_bom[] from utf.[ch] in git_parse_source()
  utf8-bom: introduce skip_utf8_bom() helper
  add_excludes_from_file: clarify the bom skipping logic
  dir: allow a BOM at the beginning of exclude files

9 years agoMerge branch 'jk/prune-mtime' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:50 +0000 (14:05 -0700)] 
Merge branch 'jk/prune-mtime' into maint

Access to objects in repositories that borrow from another one on a
slow NFS server unnecessarily got more expensive due to recent code
becoming more cautious in a naive way not to lose objects to pruning.

* jk/prune-mtime:
  sha1_file: only freshen packs once per run
  sha1_file: freshen pack objects before loose
  reachable: only mark local objects as recent

9 years agoMerge branch 'jk/init-core-worktree-at-root' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:49 +0000 (14:05 -0700)] 
Merge branch 'jk/init-core-worktree-at-root' into maint

We avoid setting core.worktree when the repository location is the
".git" directory directly at the top level of the working tree, but
the code misdetected the case in which the working tree is at the
root level of the filesystem (which arguably is a silly thing to
do, but still valid).

* jk/init-core-worktree-at-root:
  init: don't set core.worktree when initializing /.git

9 years agolog: do not shorten decoration names too early
Junio C Hamano [Wed, 13 May 2015 19:40:35 +0000 (12:40 -0700)] 
log: do not shorten decoration names too early

The DECORATE_SHORT_REFS option given to load_ref_decorations()
affects the way a copy of the refname is stored for each decorated
commit, and this forces later steps like current_pointed_by_HEAD()
to adjust their behaviour based on this initial settings.

Instead, we can always store the full refname and then shorten them
when producing the output.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolog: decorate HEAD with branch name under --decorate=full, too
Junio C Hamano [Wed, 13 May 2015 17:25:18 +0000 (10:25 -0700)] 
log: decorate HEAD with branch name under --decorate=full, too

The previous step to teach "log --decorate" to show "HEAD -> master"
instead of "HEAD, master" when showing the commit at the tip of the
'master' branch, when the 'master' branch is checked out, did not
work for "log --decorate=full".

The commands in the "log" family prepare commit decorations for all
refs upfront, and the actual string used in a decoration depends on
how load_ref_decorations() is called very early in the process.  By
default, "git log --decorate" stores names with common prefixes such
as "refs/heads" stripped; "git log --decorate=full" stores the full
refnames.

When the current_pointed_by_HEAD() function has to decide if "HEAD"
points at the branch a decoration describes, however, what was
passed to load_ref_decorations() to decide to strip (or keep) such a
common prefix is long lost.  This makes it impossible to reliably
tell if a decoration that stores "refs/heads/master", for example,
is the 'master' branch (under "--decorate" with prefix omitted) or
'refs/heads/master' branch (under "--decorate=full").

Keep what was passed to load_ref_decorations() in a global next to
the global variable name_decoration, and use that to decide how to
match what was read from "HEAD" and what is in a decoration.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: put example URLs and emails inside literal backticks
Jeff King [Wed, 13 May 2015 05:06:21 +0000 (01:06 -0400)] 
doc: put example URLs and emails inside literal backticks

This makes sure that AsciiDoc does not turn them into links.
Regular AsciiDoc does not catch these cases, but AsciiDoctor
does treat them as links.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: drop backslash quoting of some curly braces
Jeff King [Wed, 13 May 2015 05:02:22 +0000 (01:02 -0400)] 
doc: drop backslash quoting of some curly braces

Text like "{foo}" triggers an AsciiDoc attribute; we have to
write "\{foo}" to suppress this. But when the "foo" is not a
syntactically valid attribute, we can skip the quoting. This
makes the source nicer to read, and looks better under
Asciidoctor. With AsciiDoc itself, this patch produces no
changes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: convert \--option to --option
Jeff King [Wed, 13 May 2015 05:01:38 +0000 (01:01 -0400)] 
doc: convert \--option to --option

Older versions of AsciiDoc would convert the "--" in
"--option" into an emdash. According to 565e135
(Documentation: quote double-dash for AsciiDoc, 2011-06-29),
this is fixed in AsciiDoc 8.3.0. According to bf17126, we
don't support anything older than 8.4.1 anyway, so we no
longer need to worry about quoting.

Even though this does not change the output at all, there
are a few good reasons to drop the quoting:

  1. It makes the source prettier to read.

  2. We don't quote consistently, which may be confusing when
     reading the source.

  3. Asciidoctor does not like the quoting, and renders a
     literal backslash.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc/add: reformat `--edit` option
Jeff King [Wed, 13 May 2015 04:58:51 +0000 (00:58 -0400)] 
doc/add: reformat `--edit` option

All of the other options in the list put short and long as
two separate headings.

We can also drop the backslashing of `--`. It isn't used
elsewhere and is unnecessary for modern asciidoc (plus it
confuses asciidoctor).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: fix length of underlined section-title
Jeff King [Wed, 13 May 2015 04:58:29 +0000 (00:58 -0400)] 
doc: fix length of underlined section-title

In AsciiDoc, it is OK to say:

   this is my title
   -------------------------

but AsciiDoctor is more strict. Let's match the underline to
the title (which also makes the source prettier to read).
The output from AsciiDoc is the same either way.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: fix hanging "+"-continuation
Jeff King [Wed, 13 May 2015 04:58:16 +0000 (00:58 -0400)] 
doc: fix hanging "+"-continuation

In list content that wants to continue to a second
paragraph, the "+" continuation and subsequent paragraph
need to be left-aligned. Otherwise AsciiDoc seems to insert
only a linebreak.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: fix unquoted use of "{type}"
Jeff King [Wed, 13 May 2015 04:58:06 +0000 (00:58 -0400)] 
doc: fix unquoted use of "{type}"

Curly braces open an "attribute" in AsciiDoc; if there's no
such attribute, strange things may happen. In this case, the
unquoted "{type}" causes AsciiDoc to omit an entire line of
text from the output. We can fix it by putting the whole
phrase inside literal backticks (which also lets us get rid
of ugly backslash escaping).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: fix misrendering due to `single quote'
Jeff King [Wed, 13 May 2015 04:57:54 +0000 (00:57 -0400)] 
doc: fix misrendering due to `single quote'

AsciiDoc misparses some text that contains a `literal`
word followed by a fancy `single quote' word, and treats
everything from the start of the literal to the end of the
quote as a single-quoted phrase.

We can work around this by switching the latter to be a
literal, as well. In the first case, this is perhaps what
was intended anyway, as it makes us consistent with the the
earlier literals in the same paragraph. In the second, the
output is arguably better, as we will format our commit
references as <code> blocks.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: fix unmatched code fences in git-stripspace
Jeff King [Wed, 13 May 2015 02:15:56 +0000 (22:15 -0400)] 
doc: fix unmatched code fences in git-stripspace

The asciidoctor renderer is more picky than classic asciidoc,
and insists that the start and end of a code fence be the
same size.

Found with this hacky perl script:

    foreach my $fn (@ARGV) {
      open(my $fh, '<', $fn);
      my ($fence, $fence_lineno, $prev);
      while (<$fh>) {
        chomp;
        if (/^----+$/) {
          if ($fence_lineno) {
            if ($_ ne $fence) {
              print "$fn:$fence_lineno:mismatched fence: ",
                    length($fence), " != ", length($_), "\n";
            }
            $fence_lineno = undef;
          }
  # hacky check to avoid title-underlining
          elsif ($prev eq '' || $prev eq '+') {
            $fence = $_;
            $fence_lineno = $.;
          }
        }
        $prev = $_;
      }
    }

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mh/write-refs-sooner-2.3' into mh/write-refs-sooner-2.4
Junio C Hamano [Wed, 13 May 2015 04:28:54 +0000 (21:28 -0700)] 
Merge branch 'mh/write-refs-sooner-2.3' into mh/write-refs-sooner-2.4

* mh/write-refs-sooner-2.3:
  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

9 years agoref_transaction_commit(): fix atomicity and avoid fd exhaustion
Michael Haggerty [Fri, 24 Apr 2015 11:35:49 +0000 (13:35 +0200)] 
ref_transaction_commit(): fix atomicity and avoid fd exhaustion

The old code was roughly

    for update in updates:
        acquire locks and check old_sha
    for update in updates:
        if changing value:
            write_ref_to_lockfile()
            commit_ref_update()
    for update in updates:
        if deleting value:
            unlink()
    rewrite packed-refs file
    for update in updates:
        if reference still locked:
            unlock_ref()

This has two problems.

Non-atomic updates
==================

The atomicity of the reference transaction depends on all pre-checks
being done in the first loop, before any changes have started being
committed in the second loop. The problem is that
write_ref_to_lockfile() (previously part of write_ref_sha1()), which
is called from the second loop, contains two more checks:

* It verifies that new_sha1 is a valid object

* If the reference being updated is a branch, it verifies that
  new_sha1 points at a commit object (as opposed to a tag, tree, or
  blob).

If either of these checks fails, the "transaction" is aborted during
the second loop. But this might happen after some reference updates
have already been permanently committed. In other words, the
all-or-nothing promise of "git update-ref --stdin" could be violated.

So these checks have to be moved to the first loop.

File descriptor exhaustion
==========================

The old code locked all of the references in the first loop, leaving
all of the lockfiles open until later loops. Since we might be
updating a lot of references, this could result in file descriptor
exhaustion.

The solution
============

After this patch, the code looks like

    for update in updates:
        acquire locks and check old_sha
        if changing value:
            write_ref_to_lockfile()
        else:
            close_ref()
    for update in updates:
        if changing value:
            commit_ref_update()
    for update in updates:
        if deleting value:
            unlink()
    rewrite packed-refs file
    for update in updates:
        if reference still locked:
            unlock_ref()

This fixes both problems:

1. The pre-checks in write_ref_to_lockfile() are now done in the first
   loop, before any changes have been committed. If any of the checks
   fails, the whole transaction can now be rolled back correctly.

2. All lockfiles are closed in the first loop immediately after they
   are created (either by write_ref_to_lockfile() or by close_ref()).
   This means that there is never more than one open lockfile at a
   time, preventing file descriptor exhaustion.

To simplify the bookkeeping across loops, add a new REF_NEEDS_COMMIT
bit to update->flags, which keeps track of whether the corresponding
lockfile needs to be committed, as opposed to just unlocked. (Since
"struct ref_update" is internal to the refs module, this change is not
visible to external callers.)

This change fixes two tests in t1400.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoref_transaction_commit(): remove the local flags variable
Michael Haggerty [Fri, 24 Apr 2015 11:35:48 +0000 (13:35 +0200)] 
ref_transaction_commit(): remove the local flags variable

Instead, work directly with update->flags. This has the advantage that
the REF_DELETING bit, set in the first loop, can be read in the second
loop instead of having to be recomputed. Plus, it was potentially
confusing having both update->flags and flags, which sometimes had
different values.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoref_transaction_commit(): inline call to write_ref_sha1()
Michael Haggerty [Sat, 9 May 2015 15:29:20 +0000 (17:29 +0200)] 
ref_transaction_commit(): inline call to write_ref_sha1()

That was the last caller, so delete function write_ref_sha1().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorename_ref(): inline calls to write_ref_sha1() from this function
Michael Haggerty [Sat, 9 May 2015 15:20:39 +0000 (17:20 +0200)] 
rename_ref(): inline calls to write_ref_sha1() from this function

Most of what it does is unneeded from these call sites.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit_ref_update(): new function, extracted from write_ref_sha1()
Michael Haggerty [Sat, 9 May 2015 15:18:36 +0000 (17:18 +0200)] 
commit_ref_update(): new function, extracted from write_ref_sha1()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agowrite_ref_to_lockfile(): new function, extracted from write_ref_sha1()
Michael Haggerty [Fri, 24 Apr 2015 11:35:45 +0000 (13:35 +0200)] 
write_ref_to_lockfile(): new function, extracted from write_ref_sha1()

This is the first step towards separating the checking and writing of
the new reference value to committing the change.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
Stefan Beller [Tue, 14 Apr 2015 22:25:07 +0000 (15:25 -0700)] 
t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE

During creation of the patch series our discussion we could have a
more descriptive name for the prerequisite for the test so it stays
unique when other limits of ulimit are introduced.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoupdate-ref: test handling large transactions properly
Stefan Beller [Tue, 14 Apr 2015 22:25:06 +0000 (15:25 -0700)] 
update-ref: test handling large transactions properly

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mh/write-refs-sooner-2.2' into mh/write-refs-sooner-2.3
Junio C Hamano [Wed, 13 May 2015 04:26:09 +0000 (21:26 -0700)] 
Merge branch 'mh/write-refs-sooner-2.2' into mh/write-refs-sooner-2.3

* mh/write-refs-sooner-2.2:
  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

9 years agoref_transaction_commit(): fix atomicity and avoid fd exhaustion
Michael Haggerty [Sun, 10 May 2015 02:45:37 +0000 (04:45 +0200)] 
ref_transaction_commit(): fix atomicity and avoid fd exhaustion

The old code was roughly

    for update in updates:
        acquire locks and check old_sha
    for update in updates:
        if changing value:
            write_ref_to_lockfile()
            commit_ref_update()
    for update in updates:
        if deleting value:
            unlink()
    rewrite packed-refs file
    for update in updates:
        if reference still locked:
            unlock_ref()

This has two problems.

Non-atomic updates
==================

The atomicity of the reference transaction depends on all pre-checks
being done in the first loop, before any changes have started being
committed in the second loop. The problem is that
write_ref_to_lockfile() (previously part of write_ref_sha1()), which
is called from the second loop, contains two more checks:

* It verifies that new_sha1 is a valid object

* If the reference being updated is a branch, it verifies that
  new_sha1 points at a commit object (as opposed to a tag, tree, or
  blob).

If either of these checks fails, the "transaction" is aborted during
the second loop. But this might happen after some reference updates
have already been permanently committed. In other words, the
all-or-nothing promise of "git update-ref --stdin" could be violated.

So these checks have to be moved to the first loop.

File descriptor exhaustion
==========================

The old code locked all of the references in the first loop, leaving
all of the lockfiles open until later loops. Since we might be
updating a lot of references, this could result in file descriptor
exhaustion.

The solution
============

After this patch, the code looks like

    for update in updates:
        acquire locks and check old_sha
        if changing value:
            write_ref_to_lockfile()
        else:
            close_ref()
    for update in updates:
        if changing value:
            commit_ref_update()
    for update in updates:
        if deleting value:
            unlink()
    rewrite packed-refs file
    for update in updates:
        if reference still locked:
            unlock_ref()

This fixes both problems:

1. The pre-checks in write_ref_to_lockfile() are now done in the first
   loop, before any changes have been committed. If any of the checks
   fails, the whole transaction can now be rolled back correctly.

2. All lockfiles are closed in the first loop immediately after they
   are created (either by write_ref_to_lockfile() or by close_ref()).
   This means that there is never more than one open lockfile at a
   time, preventing file descriptor exhaustion.

To simplify the bookkeeping across loops, add a new REF_NEEDS_COMMIT
bit to update->flags, which keeps track of whether the corresponding
lockfile needs to be committed, as opposed to just unlocked. (Since
"struct ref_update" is internal to the refs module, this change is not
visible to external callers.)

This change fixes two tests in t1400.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoref_transaction_commit(): remove the local flags variable
Michael Haggerty [Sun, 10 May 2015 02:45:36 +0000 (04:45 +0200)] 
ref_transaction_commit(): remove the local flags variable

Instead, work directly with update->flags. This has the advantage that
the REF_DELETING bit, set in the first loop, can be read in the second
loop instead of having to be recomputed. Plus, it was potentially
confusing having both update->flags and flags, which sometimes had
different values.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoref_transaction_commit(): inline call to write_ref_sha1()
Michael Haggerty [Sun, 10 May 2015 02:45:35 +0000 (04:45 +0200)] 
ref_transaction_commit(): inline call to write_ref_sha1()

And remove the function write_ref_sha1(), as it is no longer used.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorename_ref(): inline calls to write_ref_sha1() from this function
Michael Haggerty [Sun, 10 May 2015 02:45:34 +0000 (04:45 +0200)] 
rename_ref(): inline calls to write_ref_sha1() from this function

Most of what it does is unneeded from these call sites.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit_ref_update(): new function, extracted from write_ref_sha1()
Michael Haggerty [Sun, 10 May 2015 02:45:33 +0000 (04:45 +0200)] 
commit_ref_update(): new function, extracted from write_ref_sha1()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agowrite_ref_to_lockfile(): new function, extracted from write_ref_sha1()
Michael Haggerty [Sun, 10 May 2015 02:45:32 +0000 (04:45 +0200)] 
write_ref_to_lockfile(): new function, extracted from write_ref_sha1()

This is the first step towards separating the checking and writing of
the new reference value to committing the change.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
Stefan Beller [Sun, 10 May 2015 02:45:31 +0000 (04:45 +0200)] 
t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE

During creation of the patch series, our discussion revealed that
we could have a more descriptive name for the prerequisite for the
test so it stays unique when other limits of ulimit are introduced.

Let's rename the existing ulimit about setting the stack size to
a more explicit ULIMIT_STACK_SIZE.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoadd: check return value of launch_editor
Jeff King [Wed, 13 May 2015 01:21:58 +0000 (21:21 -0400)] 
add: check return value of launch_editor

When running "add -e", if launching the editor fails, we do
not notice and continue as if the output is what the user
asked for. The likely case is that the editor did not touch
the contents at all, and we end up adding everything.

Reported-by: Russ Cox <rsc@golang.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocompletion: simplify query for config variables
SZEDER Gábor [Sun, 10 May 2015 12:50:18 +0000 (14:50 +0200)] 
completion: simplify query for config variables

To get the name of all config variables in a given section we perform a
'git config --get-regex' query for all config variables containing the
name of that section, and then filter its output through a case statement
to throw away those that though contain but don't start with the given
section.

Modify the regex to match only at the beginning, so the case statement
becomes unnecessary and we can get rid of it.  Add a test to check that a
match in the middle doesn't fool us.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocompletion: add a helper function to get config variables
SZEDER Gábor [Sun, 10 May 2015 12:50:17 +0000 (14:50 +0200)] 
completion: add a helper function to get config variables

Currently there are a few completion functions that perform similar 'git
config' queries and filtering to get config variable names: the completion
of pretty aliases, aliases, and remote groups for 'git remote update'.

Unify those 'git config' queries in a helper function to eliminate code
duplication.

Though the helper functions to get pretty aliases and alieses are reduced
to mere one-liner wrappers around the newly added function, keep these
helpers still, because users' completion functions out there might depend
on them.  And they keep their callers a tad easier to read, too.

Add tests for the pretty alias and alias helper to show that they work
as before; not for the remote groups query, though, because that's not
extracted into a helper function and it's not worth the effort to do so
for a sole callsite.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: fix unmatched code fences
Jean-Noel Avila [Tue, 12 May 2015 17:23:20 +0000 (19:23 +0200)] 
doc: fix unmatched code fences

This mismatch upsets the renderer on git-scm.com.

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'maint'
Junio C Hamano [Mon, 11 May 2015 21:39:39 +0000 (14:39 -0700)] 
Merge branch 'maint'

* maint:
  Git 2.3.8

9 years agoSync with 2.3.8
Junio C Hamano [Mon, 11 May 2015 21:39:28 +0000 (14:39 -0700)] 
Sync with 2.3.8

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoGit 2.3.8 v2.3.8
Junio C Hamano [Mon, 11 May 2015 21:36:31 +0000 (14:36 -0700)] 
Git 2.3.8

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mm/usage-log-l-can-take-regex' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:34:01 +0000 (14:34 -0700)] 
Merge branch 'mm/usage-log-l-can-take-regex' into maint-2.3

Documentation fix.

* mm/usage-log-l-can-take-regex:
  log -L: improve error message on malformed argument
  Documentation: change -L:<regex> to -L:<funcname>

9 years agoMerge branch 'jc/diff-no-index-d-f' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:34:00 +0000 (14:34 -0700)] 
Merge branch 'jc/diff-no-index-d-f' into maint-2.3

The usual "git diff" when seeing a file turning into a directory
showed a patchset to remove the file and create all files in the
directory, but "git diff --no-index" simply refused to work.  Also,
when asked to compare a file and a directory, imitate POSIX "diff"
and compare the file with the file with the same name in the
directory, instead of refusing to run.

* jc/diff-no-index-d-f:
  diff-no-index: align D/F handling with that of normal Git
  diff-no-index: DWIM "diff D F" into "diff D/F F"

9 years agoMerge branch 'oh/fix-config-default-user-name-section' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:33:59 +0000 (14:33 -0700)] 
Merge branch 'oh/fix-config-default-user-name-section' into maint-2.3

The default $HOME/.gitconfig file created upon "git config --global"
that edits it had incorrectly spelled user.name and user.email
entries in it.

* oh/fix-config-default-user-name-section:
  config: fix settings in default_user_config template

9 years agoMerge branch 'jc/epochtime-wo-tz' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:33:58 +0000 (14:33 -0700)] 
Merge branch 'jc/epochtime-wo-tz' into maint-2.3

"git commit --date=now" or anything that relies on approxidate lost
the daylight-saving-time offset.

* jc/epochtime-wo-tz:
  parse_date_basic(): let the system handle DST conversion
  parse_date_basic(): return early when given a bogus timestamp

9 years agoSecond batch for 2.5 cycle
Junio C Hamano [Mon, 11 May 2015 21:31:28 +0000 (14:31 -0700)] 
Second batch for 2.5 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'pt/xdg-config-path'
Junio C Hamano [Mon, 11 May 2015 21:24:01 +0000 (14:24 -0700)] 
Merge branch 'pt/xdg-config-path'

Code clean-up for xdg configuration path support.

* pt/xdg-config-path:
  path.c: remove home_config_paths()
  git-config: replace use of home_config_paths()
  git-commit: replace use of home_config_paths()
  credential-store.c: replace home_config_paths() with xdg_config_home()
  dir.c: replace home_config_paths() with xdg_config_home()
  attr.c: replace home_config_paths() with xdg_config_home()
  path.c: implement xdg_config_home()

9 years agoMerge branch 'ep/do-not-feed-a-pointer-to-array-size'
Junio C Hamano [Mon, 11 May 2015 21:24:00 +0000 (14:24 -0700)] 
Merge branch 'ep/do-not-feed-a-pointer-to-array-size'

Catch a programmer mistake to feed a pointer not an array to
ARRAY_SIZE() macro, by using a couple of GCC extensions.

* ep/do-not-feed-a-pointer-to-array-size:
  git-compat-util.h: implement a different ARRAY_SIZE macro for for safely deriving the size of array

9 years agoMerge branch 'jc/hash-object'
Junio C Hamano [Mon, 11 May 2015 21:23:59 +0000 (14:23 -0700)] 
Merge branch 'jc/hash-object'

"hash-object --literally" introduced in v2.2 was not prepared to
take a really long object type name.

* jc/hash-object:
  write_sha1_file(): do not use a separate sha1[] array
  t1007: add hash-object --literally tests
  hash-object --literally: fix buffer overrun with extra-long object type
  git-hash-object.txt: document --literally option

9 years agoMerge branch 'sb/prefix-path-free-results'
Junio C Hamano [Mon, 11 May 2015 21:23:57 +0000 (14:23 -0700)] 
Merge branch 'sb/prefix-path-free-results'

Code clean-up (not a leak-fix).

* sb/prefix-path-free-results:
  prefix_path(): unconditionally free results in the callers

9 years agoMerge branch 'sg/completion-no-redundant-all-command-list'
Junio C Hamano [Mon, 11 May 2015 21:23:57 +0000 (14:23 -0700)] 
Merge branch 'sg/completion-no-redundant-all-command-list'

Code simplification.

* sg/completion-no-redundant-all-command-list:
  completion: remove redundant __git_compute_all_commands() call

9 years agoMerge branch 'sg/complete-decorate-full-not-long'
Junio C Hamano [Mon, 11 May 2015 21:23:55 +0000 (14:23 -0700)] 
Merge branch 'sg/complete-decorate-full-not-long'

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

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

9 years agoMerge branch 'jk/filter-branch-use-of-sed-on-incomplete-line'
Junio C Hamano [Mon, 11 May 2015 21:23:54 +0000 (14:23 -0700)] 
Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line'

"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

9 years agoMerge branch 'jc/daemon-no-ipv6-for-2.4.1'
Junio C Hamano [Mon, 11 May 2015 21:23:53 +0000 (14:23 -0700)] 
Merge branch 'jc/daemon-no-ipv6-for-2.4.1'

"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

9 years agoMerge branch 'jn/clean-use-error-not-fprintf-on-stderr'
Junio C Hamano [Mon, 11 May 2015 21:23:52 +0000 (14:23 -0700)] 
Merge branch 'jn/clean-use-error-not-fprintf-on-stderr'

Some error messages in "git config" were emitted without calling
the usual error() facility.

* jn/clean-use-error-not-fprintf-on-stderr:
  config: use error() instead of fprintf(stderr, ...)