OSDN Git Service

git-core/git.git
9 years agoGit 2.4.4 v2.4.4
Junio C Hamano [Tue, 16 Jun 2015 21:38:01 +0000 (14:38 -0700)]
Git 2.4.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jk/clone-dissociate' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:52 +0000 (14:33 -0700)]
Merge branch 'jk/clone-dissociate' into maint

Code clean-up.

* jk/clone-dissociate:
  clone: reorder --dissociate and --reference options
  clone: use OPT_STRING_LIST for --reference

9 years agoMerge branch 'sb/submodule-doc-intro' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:52 +0000 (14:33 -0700)]
Merge branch 'sb/submodule-doc-intro' into maint

* sb/submodule-doc-intro:
  submodule doc: reorder introductory paragraphs

9 years agoMerge branch 'sb/glossary-submodule' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:51 +0000 (14:33 -0700)]
Merge branch 'sb/glossary-submodule' into maint

* sb/glossary-submodule:
  glossary: add "remote", "submodule", "superproject"

9 years agoMerge branch 'ah/usage-strings' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:50 +0000 (14:33 -0700)]
Merge branch 'ah/usage-strings' into maint

A few usage string updates.

* ah/usage-strings:
  blame, log: format usage strings similarly to those in documentation

9 years agoMerge branch 'mc/commit-doc-grammofix' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:49 +0000 (14:33 -0700)]
Merge branch 'mc/commit-doc-grammofix' into maint

Doc grammar fix.

* mc/commit-doc-grammofix:
  Documentation/git-commit: grammofix

9 years agoMerge branch 'rs/janitorial' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:47 +0000 (14:33 -0700)]
Merge branch 'rs/janitorial' into maint

Code clean-up.

* rs/janitorial:
  dir: remove unused variable sb
  clean: remove unused variable buf
  use file_exists() to check if a file exists in the worktree

9 years agoMerge branch 'sb/test-bitmap-free-at-end' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:47 +0000 (14:33 -0700)]
Merge branch 'sb/test-bitmap-free-at-end' into maint

An earlier leakfix to bitmap testing code was incomplete.

* sb/test-bitmap-free-at-end:
  test_bitmap_walk: free bitmap with bitmap_free

9 years agoMerge branch 'dt/clean-pathspec-filter-then-lstat' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:46 +0000 (14:33 -0700)]
Merge branch 'dt/clean-pathspec-filter-then-lstat' into maint

"git clean pathspec..." tried to lstat(2) and complain even for
paths outside the given pathspec.

* dt/clean-pathspec-filter-then-lstat:
  clean: only lstat files in pathspec

9 years agoMerge branch 'jk/http-backend-deadlock' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:45 +0000 (14:33 -0700)]
Merge branch 'jk/http-backend-deadlock' into maint

Communication between the HTTP server and http_backend process can
lead to a dead-lock when relaying a large ref negotiation request.
Diagnose the situation better, and mitigate it by reading such a
request first into core (to a reasonable limit).

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

9 years agoMerge branch 'jh/filter-empty-contents' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:44 +0000 (14:33 -0700)]
Merge branch 'jh/filter-empty-contents' into maint

The clean/smudge interface did not work well when filtering an
empty contents (failed and then passed the empty input through).
It can be argued that a filter that produces anything but empty for
an empty input is nonsense, but if the user wants to do strange
things, then why not?

* jh/filter-empty-contents:
  sha1_file: pass empty buffer to index empty file

9 years agoMerge branch 'jk/stash-options' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:43 +0000 (14:33 -0700)]
Merge branch 'jk/stash-options' into maint

Make "git stash something --help" error out, so that users can
safely say "git stash drop --help".

* jk/stash-options:
  stash: recognize "--help" for subcommands
  stash: complain about unknown flags

9 years agoMerge branch 'mm/log-format-raw-doc' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:42 +0000 (14:33 -0700)]
Merge branch 'mm/log-format-raw-doc' into maint

Clarify that "log --raw" and "log --format=raw" are unrelated
concepts.

* mm/log-format-raw-doc:
  Documentation/log: clarify sha1 non-abbreviation in log --raw
  Documentation/log: clarify what --raw means

9 years agoMerge branch 'ep/do-not-feed-a-pointer-to-array-size' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:41 +0000 (14:33 -0700)]
Merge branch 'ep/do-not-feed-a-pointer-to-array-size' into maint

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 tag 'l10n-2.4-maint-de-updates' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Sun, 14 Jun 2015 21:24:49 +0000 (14:24 -0700)]
Merge tag 'l10n-2.4-maint-de-updates' of git://github.com/git-l10n/git-po into maint

l10n-2.4-maint-de-updates

* tag 'l10n-2.4-maint-de-updates' of git://github.com/git-l10n/git-po:
  l10n: de.po: translation fix for fall-back to 3way merge
  l10n: de.po: punctuation fixes
  l10n: de.po: grammar fix
  l10n: de.po: change error message from "sagen" to "Meinten Sie"

9 years agol10n: de.po: translation fix for fall-back to 3way merge
Michael J Gruber [Tue, 19 May 2015 08:51:34 +0000 (10:51 +0200)]
l10n: de.po: translation fix for fall-back to 3way merge

The English version is correct, but misleading: It is not the 3way merge
that is being patched also, but that is being fallen back to also.

The German version translates the former meaning. Make it translate the
latter.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agol10n: de.po: punctuation fixes
Michael J Gruber [Tue, 19 May 2015 08:51:33 +0000 (10:51 +0200)]
l10n: de.po: punctuation fixes

This respects the ellipsis style used in de.po.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agol10n: de.po: grammar fix
Michael J Gruber [Tue, 19 May 2015 08:51:32 +0000 (10:51 +0200)]
l10n: de.po: grammar fix

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agol10n: de.po: change error message from "sagen" to "Meinten Sie"
Phillip Sz [Sat, 9 May 2015 11:28:55 +0000 (13:28 +0200)]
l10n: de.po: change error message from "sagen" to "Meinten Sie"

We should not use "sagen" if someone has written something wrong.
Although it's "say" in English, we should not use it in German
and instead use our normal error message.

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agoGit 2.4.3 v2.4.3
Junio C Hamano [Fri, 5 Jun 2015 19:15:57 +0000 (12:15 -0700)]
Git 2.4.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'dl/branch-error-message' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:29 +0000 (12:00 -0700)]
Merge branch 'dl/branch-error-message' into maint

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 agoMerge branch 'jk/skip-http-tests-under-no-curl' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:28 +0000 (12:00 -0700)]
Merge branch 'jk/skip-http-tests-under-no-curl' into maint

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 'ps/doc-packfile-vs-pack-file' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:27 +0000 (12:00 -0700)]
Merge branch 'ps/doc-packfile-vs-pack-file' into maint

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"

9 years agoMerge branch 'fg/document-commit-message-stripping' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:26 +0000 (12:00 -0700)]
Merge branch 'fg/document-commit-message-stripping' into maint

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

9 years agoMerge branch 'jk/rerere-forget-check-enabled' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:25 +0000 (12:00 -0700)]
Merge branch 'jk/rerere-forget-check-enabled' into maint

"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

9 years agoMerge branch 'pt/pull-log-n' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:24 +0000 (12:00 -0700)]
Merge branch 'pt/pull-log-n' into maint

"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>

9 years agoMerge branch 'pt/pull-ff-vs-merge-ff' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:23 +0000 (12:00 -0700)]
Merge branch 'pt/pull-ff-vs-merge-ff' into maint

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

9 years agoMerge branch 'rs/plug-leak-in-pack-bitmaps' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:22 +0000 (12:00 -0700)]
Merge branch 'rs/plug-leak-in-pack-bitmaps' into maint

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

9 years agoMerge branch 'ja/tutorial-asciidoctor-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:22 +0000 (12:00 -0700)]
Merge branch 'ja/tutorial-asciidoctor-fix' into maint

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 'jk/stripspace-asciidoctor-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:20 +0000 (12:00 -0700)]
Merge branch 'jk/stripspace-asciidoctor-fix' into maint

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 'jk/asciidoc-markup-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:19 +0000 (12:00 -0700)]
Merge branch 'jk/asciidoc-markup-fix' into maint

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 'ps/bundle-verify-arg' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:18 +0000 (12:00 -0700)]
Merge branch 'ps/bundle-verify-arg' into maint

"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 'mh/write-refs-sooner-2.4' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:17 +0000 (12:00 -0700)]
Merge branch 'mh/write-refs-sooner-2.4' into maint

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 'mh/ref-directory-file' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:16 +0000 (12:00 -0700)]
Merge branch 'mh/ref-directory-file' into maint

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 'mg/log-decorate-HEAD' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:15 +0000 (12:00 -0700)]
Merge branch 'mg/log-decorate-HEAD' into maint

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 'sb/t1020-cleanup' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:14 +0000 (12:00 -0700)]
Merge branch 'sb/t1020-cleanup' into maint

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

9 years agoMerge branch 'jc/gitignore-precedence' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:12 +0000 (12:00 -0700)]
Merge branch 'jc/gitignore-precedence' into maint

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 'bc/connect-plink' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:11 +0000 (12:00 -0700)]
Merge branch 'bc/connect-plink' into maint

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 'ph/rebase-i-redo' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:10 +0000 (12:00 -0700)]
Merge branch 'ph/rebase-i-redo' into maint

"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 'jk/add-e-kill-editor' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:09 +0000 (12:00 -0700)]
Merge branch 'jk/add-e-kill-editor' into maint

"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 'mh/clone-verbosity-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:08 +0000 (12:00 -0700)]
Merge branch 'mh/clone-verbosity-fix' into maint

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 'jk/sha1-file-reduce-useless-warnings' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:07 +0000 (12:00 -0700)]
Merge branch 'jk/sha1-file-reduce-useless-warnings' into maint

* jk/sha1-file-reduce-useless-warnings:
  sha1_file: squelch "packfile cannot be accessed" warnings

9 years agoMerge branch 'tb/blame-resurrect-convert-to-git' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:06 +0000 (12:00 -0700)]
Merge branch 'tb/blame-resurrect-convert-to-git' into maint

Some time ago, "git blame" (incorrectly) lost the convert_to_git()
call when synthesizing a fake "tip" commit that represents the
state in the working tree, which broke folks who record the history
with LF line ending to make their project portabile across
platforms while terminating lines in their working tree files with
CRLF for their platform.

* tb/blame-resurrect-convert-to-git:
  blame: CRLF in the working tree and LF in the repo

9 years agoMerge branch 'jc/plug-fmt-merge-msg-leak' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:05 +0000 (12:00 -0700)]
Merge branch 'jc/plug-fmt-merge-msg-leak' into maint

* jc/plug-fmt-merge-msg-leak:
  fmt-merge-msg: plug small leak of commit buffer

9 years agoMerge branch 'pt/xdg-config-path' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:03 +0000 (12:00 -0700)]
Merge branch 'pt/xdg-config-path' into maint

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()
  t0302: "unreadable" test needs POSIXPERM
  t0302: test credential-store support for XDG_CONFIG_HOME
  git-credential-store: support XDG_CONFIG_HOME
  git-credential-store: support multiple credential files

9 years agoglossary: add "remote", "submodule", "superproject"
Stefan Beller [Fri, 29 May 2015 18:23:56 +0000 (11:23 -0700)]
glossary: add "remote", "submodule", "superproject"

Noticed-by: Philip Oakley <philipoakley@iee.org>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosubmodule doc: reorder introductory paragraphs
Stefan Beller [Wed, 27 May 2015 19:48:01 +0000 (12:48 -0700)]
submodule doc: reorder introductory paragraphs

It's better to start the man page with a description of what
submodules actually are, instead of saying what they are not.

Reorder the paragraphs such that

 - the first short paragraph introduces the submodule concept,
 - the second paragraph highlights the usage of the submodule command,
 - the third paragraph giving background information, and finally
 - the fourth paragraph discusing alternatives such as subtrees and
   remotes, which we don't want to be confused with.

This ordering deepens the knowledge on submodules with each paragraph.
First the basic questions like "How/what" will be answered, while the
underlying concepts will be taught at a later time.

Making sure it is not confused with subtrees and remotes is not really
enhancing knowledge of submodules itself, but rather painting the big
picture of git concepts, so you could also argue to have it as the second
paragraph. Personally I think this may confuse readers, specially
newcomers though.

Additionally to reordering the paragraphs, they have been slightly
reworded.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoclone: reorder --dissociate and --reference options
Jeff King [Thu, 21 May 2015 04:16:04 +0000 (00:16 -0400)]
clone: reorder --dissociate and --reference options

These options are intimately related, so it makes sense to
list them nearby in the "-h" output (they are already
adjacent in the manpage).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoclone: use OPT_STRING_LIST for --reference
Jeff King [Thu, 21 May 2015 04:15:19 +0000 (00:15 -0400)]
clone: use OPT_STRING_LIST for --reference

Not only does this save us having to implement a custom
callback, but it handles "--no-reference" in the usual way
(to clear the list).

The generic callback does copy the string, which we don't
technically need, but that should not hurt anything.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoGit 2.4.2 v2.4.2
Junio C Hamano [Tue, 26 May 2015 20:49:59 +0000 (13:49 -0700)]
Git 2.4.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jk/still-interesting' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:26 +0000 (13:49 -0700)]
Merge branch 'jk/still-interesting' into maint

"git rev-list --objects $old --not --all" to see if everything that
is reachable from $old is already connected to the existing refs
was very inefficient.

* jk/still-interesting:
  limit_list: avoid quadratic behavior from still_interesting

9 years agoMerge branch 'jc/hash-object' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:24 +0000 (13:49 -0700)]
Merge branch 'jc/hash-object' into maint

"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 'jk/rebase-quiet-noop' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:23 +0000 (13:49 -0700)]
Merge branch 'jk/rebase-quiet-noop' into maint

"git rebase --quiet" was not quite quiet when there is nothing to
do.

* jk/rebase-quiet-noop:
  rebase: silence "git checkout" for noop rebase

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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 <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agotest_bitmap_walk: free bitmap with bitmap_free
Jeff King [Fri, 22 May 2015 00:53:36 +0000 (20:53 -0400)]
test_bitmap_walk: free bitmap with bitmap_free

Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
noticed that we leak the "result" bitmap. But we should use
"bitmap_free" rather than straight "free", as the former
remembers to free the bitmap array pointed to by the struct.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodoc: fix inconsistent spelling of "packfile"
Patrick Steinhardt [Fri, 22 May 2015 06:22:04 +0000 (08:22 +0200)]
doc: fix inconsistent spelling of "packfile"

Fix remaining instances where "pack-file" is used instead of
"packfile". Some places remain where we still use "pack-file",
This is the case when we explicitly refer to a file with a
".pack" extension as opposed to a data source providing a pack
data stream.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoDocumentation/log: clarify sha1 non-abbreviation in log --raw
Matthieu Moy [Mon, 18 May 2015 17:55:58 +0000 (19:55 +0200)]
Documentation/log: clarify sha1 non-abbreviation in log --raw

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodir: remove unused variable sb
René Scharfe [Tue, 19 May 2015 22:13:33 +0000 (00:13 +0200)]
dir: remove unused variable sb

It had never been used.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoclean: remove unused variable buf
René Scharfe [Tue, 19 May 2015 22:13:26 +0000 (00:13 +0200)]
clean: remove unused variable buf

It had never been used.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agouse file_exists() to check if a file exists in the worktree
René Scharfe [Tue, 19 May 2015 21:44:23 +0000 (23:44 +0200)]
use file_exists() to check if a file exists in the worktree

Call file_exists() instead of open-coding it.  That's shorter, simpler
and the intent becomes clearer.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agostash: recognize "--help" for subcommands
Jeff King [Wed, 20 May 2015 18:17:46 +0000 (14:17 -0400)]
stash: recognize "--help" for subcommands

If you run "git stash --help", you get the help for stash
(this magic is done by the git wrapper itself). But if you
run "git stash drop --help", you get an error. We
cannot show help specific to "stash drop", of course, but we
can at least give the user the normal stash manpage.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agostash: complain about unknown flags
Jeff King [Wed, 20 May 2015 18:01:32 +0000 (14:01 -0400)]
stash: complain about unknown flags

The option parser for git-stash stuffs unknown flags into
the $FLAGS variable, where they can be accessed by the
individual commands. However, most commands do not even look
at these extra flags, leading to unexpected results like
this:

  $ git stash drop --help
  Dropped refs/stash@{0} (e6cf6d80faf92bb7828f7b60c47fc61c03bd30a1)

We should notice the extra flags and bail. Rather than
annotate each command to reject a non-empty $FLAGS variable,
we can notice that "stash show" is the only command that
actually _wants_ arbitrary flags. So we switch the default
mode to reject unknown flags, and let stash_show() opt into
the feature.

Reported-by: Vincent Legoll <vincent.legoll@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5551: factor out tag creation
Jeff King [Wed, 20 May 2015 07:36:43 +0000 (03:36 -0400)]
t5551: factor out tag creation

One of our tests in t5551 creates a large number of tags,
and jumps through some hoops to do it efficiently. Let's
factor that out into a function so we can make other similar
tests.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoDocumentation/git-commit: grammofix
Michael Coleman [Wed, 20 May 2015 02:41:17 +0000 (22:41 -0400)]
Documentation/git-commit: grammofix

Signed-off-by: Michael Coleman <michael.karl.coleman@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps
René Scharfe [Mon, 18 May 2015 23:24:09 +0000 (01:24 +0200)]
pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps

Use an automatic variable for recent_bitmaps, an array of pointers.
This way we don't allocate too much and don't have to free the memory
at the end.  The old code over-allocated because it reserved enough
memory to store all of the structs it is only pointing to and never
freed it.  160 64-bit pointers take up 1280 bytes, which is not too
much to be placed on the stack.

MAX_XOR_OFFSET is turned into a preprocessor constant to make it
constant enough for use in an non-variable array declaration.

Noticed-by: Stefan Beller <stefanbeller@gmail.com>
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agosubdirectory tests: code cleanup, uncomment test
Stefan Beller [Mon, 18 May 2015 21:10:26 +0000 (14:10 -0700)]
subdirectory tests: code cleanup, uncomment test

Back when these tests were written, we wanted to make sure that Git
notices it is in a bare repository and "git show -s HEAD" would
refrain from complaining that HEAD might mean a file it sees in its
current working directory (because it does not).  But the version of
Git back then didn't behave well, without (doubly) being told that
it is inside a bare repository by exporting "GIT_DIR=.".  The form
of the test we originally wanted to have was left commented out as
a reminder.

Nowadays the test as originally intended works, so add it to the
test suite.  We'll keep the old test that explicitly sets GIT_DIR=.
to make sure that use case will not regress.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoclean: only lstat files in pathspec
David Turner [Mon, 18 May 2015 18:08:46 +0000 (14:08 -0400)]
clean: only lstat files in pathspec

Even though "git clean" takes pathspec to limit the part of the
working tree to be cleaned, it checked the paths it encounters
during its directory traversal with lstat(2), before checking if
the path is within the pathspec.

Ignore paths outside pathspec and proceed without checking with
lstat(2).  Even if such a path is unreadable due to e.g. EPERM,
"git clean" should not care.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoDocumentation/log: clarify what --raw means
Matthieu Moy [Mon, 18 May 2015 17:55:57 +0000 (19:55 +0200)]
Documentation/log: clarify what --raw means

There are several "raw formats", and describing --raw as "Generate the
raw format" in the documentation for git-log seems to imply that it
generates the raw *log* format.

Clarify the wording by saying "raw diff format" explicitly, and make a
special-case for "git log": "git log --raw" does not just change the
format, it shows something which is not shown by default.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopull: parse pull.ff as a bool or string
Paul Tan [Mon, 18 May 2015 13:45:42 +0000 (21:45 +0800)]
pull: parse pull.ff as a bool or string

Since b814da8 (pull: add pull.ff configuration, 2014-01-15) git-pull
supported setting --(no-)ff via the pull.ff configuration value.
However, as it only matches the string values of "true" and "false", it
does not support other boolean aliases such as "on", "off", "1", "0".
This is inconsistent with the merge.ff setting, which supports these
aliases.

Fix this by using the bool_or_string_config function to retrieve the
value of pull.ff.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopull: make pull.ff=true override merge.ff
Paul Tan [Mon, 18 May 2015 13:45:41 +0000 (21:45 +0800)]
pull: make pull.ff=true override merge.ff

Since b814da8 (pull: add pull.ff configuration, 2014-01-15), running
git-pull with the configuration pull.ff=false or pull.ff=only is
equivalent to passing --no-ff and --ff-only to git-merge. However, if
pull.ff=true, no switch is passed to git-merge. This leads to the
confusing behavior where pull.ff=false or pull.ff=only is able to
override merge.ff, while pull.ff=true is unable to.

Fix this by adding the --ff switch if pull.ff=true, and add a test to
catch future regressions.

Furthermore, clarify in the documentation that pull.ff overrides
merge.ff.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopull: handle --log=<n>
Paul Tan [Mon, 18 May 2015 13:39:56 +0000 (21:39 +0800)]
pull: handle --log=<n>

Since efb779f (merge, pull: add '--(no-)log' command line option,
2008-04-06) git-pull supported the (--no-)log switch and would pass it
to git-merge.

96e9420 (merge: Make '--log' an integer option for number of shortlog
entries, 2010-09-08) implemented support for the --log=<n> switch, which
would explicitly set the number of shortlog entries. However, git-pull
does not recognize this option, and will instead pass it to git-fetch,
leading to "unknown option" errors.

Fix this by matching --log=* in addition to --log and --no-log.

Implement a test for this use case.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosha1_file: pass empty buffer to index empty file
Jim Hill [Mon, 18 May 2015 00:41:45 +0000 (17:41 -0700)]
sha1_file: pass empty buffer to index empty file

`git add` of an empty file with a filter pops complaints from
`copy_fd` about a bad file descriptor.

This traces back to these lines in sha1_file.c:index_core:

if (!size) {
ret = index_mem(sha1, NULL, size, type, path, flags);

The problem here is that content to be added to the index can be
supplied from an fd, or from a memory buffer, or from a pathname. This
call is supplying a NULL buffer pointer and a zero size.

Downstream logic takes the complete absence of a buffer to mean the
data is to be found elsewhere -- for instance, these, from convert.c:

if (params->src) {
write_err = (write_in_full(child_process.in, params->src, params->size) < 0);
} else {
write_err = copy_fd(params->fd, child_process.in);
}

~If there's a buffer, write from that, otherwise the data must be coming
from an open fd.~

Perfectly reasonable logic in a routine that's going to write from
either a buffer or an fd.

So change `index_core` to supply an empty buffer when indexing an empty
file.

There's a patch out there that instead changes the logic quoted above to
take a `-1` fd to mean "use the buffer", but it seems to me that the
distinction between a missing buffer and an empty one carries intrinsic
semantics, where the logic change is adapting the code to handle
incorrect arguments.

Signed-off-by: Jim Hill <gjthill@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopack-protocol.txt: fix insconsistent spelling of "packfile"
Patrick Steinhardt [Sun, 17 May 2015 06:56:54 +0000 (08:56 +0200)]
pack-protocol.txt: fix insconsistent spelling of "packfile"

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-unpack-objects.txt: fix inconsistent spelling of "packfile"
Patrick Steinhardt [Sun, 17 May 2015 06:56:53 +0000 (08:56 +0200)]
git-unpack-objects.txt: fix inconsistent spelling of "packfile"

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-verify-pack.txt: fix inconsistent spelling of "packfile"
Patrick Steinhardt [Sun, 17 May 2015 06:56:52 +0000 (08:56 +0200)]
git-verify-pack.txt: fix inconsistent spelling of "packfile"

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agohttp-backend: fix die recursion with custom handler
Jeff King [Fri, 15 May 2015 06:29:27 +0000 (02:29 -0400)]
http-backend: fix die recursion with custom handler

When we die() in http-backend, we call a custom handler that
writes an HTTP 500 response to stdout, then reports the
error to stderr. Our routines for writing out the HTTP
response may themselves die, leading to us entering die()
again.

When it was originally written, that was OK; our custom
handler keeps a variable to notice this and does not
recurse. However, since cd163d4 (usage.c: detect recursion
in die routines and bail out immediately, 2012-11-14), the
main die() implementation detects recursion before we even
get to our custom handler, and bails without printing
anything useful.

We can handle this case by doing two things:

  1. Installing a custom die_is_recursing handler that
     allows us to enter up to one level of recursion. Only
     the first call to our custom handler will try to write
     out the error response. So if we die again, that is OK.
     If we end up dying more than that, it is a sign that we
     are in an infinite recursion.

  2. Reporting the error to stderr before trying to write
     out the HTTP response. In the current code, if we do
     die() trying to write out the response, we'll exit
     immediately from this second die(), and never get a
     chance to output the original error (which is almost
     certainly the more interesting one; the second die is
     just going to be along the lines of "I tried to write
     to stdout but it was closed").

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorerere: exit silently on "forget" when rerere is disabled
Jeff King [Thu, 14 May 2015 19:20:52 +0000 (15:20 -0400)]
rerere: exit silently on "forget" when rerere is disabled

If you run "git rerere forget foo" in a repository that does
not have rerere enabled, git hits an internal error:

  $ git init -q
  $ git rerere forget foo
  fatal: BUG: attempt to commit unlocked object

The problem is that setup_rerere() will not actually take
the lock if the rerere system is disabled. We should notice
this and return early. We can return with a success code
here, because we know there is nothing to forget.

Signed-off-by: Jeff King <peff@peff.net>
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 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>