git
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 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 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 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, ...)

9 years agoMerge branch 'tb/blame-resurrect-convert-to-git'
Junio C Hamano [Mon, 11 May 2015 21:23:52 +0000 (14:23 -0700)] 
Merge branch 'tb/blame-resurrect-convert-to-git'

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 'va/fix-git-p4-tests'
Junio C Hamano [Mon, 11 May 2015 21:23:51 +0000 (14:23 -0700)] 
Merge branch 'va/fix-git-p4-tests'

* va/fix-git-p4-tests:
  git-p4: t9814: prevent --chain-lint failure

9 years agoMerge branch 'ld/p4-case-fold'
Junio C Hamano [Mon, 11 May 2015 21:23:50 +0000 (14:23 -0700)] 
Merge branch 'ld/p4-case-fold'

* ld/p4-case-fold:
  git-p4: add failing tests for case-folding p4d

9 years agoMerge branch 'jk/rebase-quiet-noop'
Junio C Hamano [Mon, 11 May 2015 21:23:49 +0000 (14:23 -0700)] 
Merge branch 'jk/rebase-quiet-noop'

"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 'va/p4-client-path'
Junio C Hamano [Mon, 11 May 2015 21:23:48 +0000 (14:23 -0700)] 
Merge branch 'va/p4-client-path'

git p4 attempts to better handle branches in Perforce.

* va/p4-client-path:
  git-p4: improve client path detection when branches are used
  t9801: check git-p4's branch detection with client spec enabled

9 years agoMerge branch 'mm/add-p-split-error'
Junio C Hamano [Mon, 11 May 2015 21:23:47 +0000 (14:23 -0700)] 
Merge branch 'mm/add-p-split-error'

When "add--interactive" splits a hunk into two overlapping hunks
and then let the user choose only one, it sometimes feeds an
incorrect patch text to "git apply".  Add tests to demonstrate
this.

I have a slight suspicion that this may be $gmane/87202 coming back
and biting us (I seem to have said "let's run with this and see
what happens" back then).

* mm/add-p-split-error:
  stash -p: demonstrate failure of split with mixed y/n
  t3904-stash-patch: factor PERL prereq at the top of the file
  t3904-stash-patch: fix test description
  add -p: demonstrate failure when running 'edit' after a split
  t3701-add-interactive: simplify code

9 years agoMerge branch 'tb/t0027-crlf'
Junio C Hamano [Mon, 11 May 2015 21:23:47 +0000 (14:23 -0700)] 
Merge branch 'tb/t0027-crlf'

More line-ending tests.

* tb/t0027-crlf:
  t0027: Add repoMIX and LF_nul
  t0027: support NATIVE_CRLF platforms
  t0027: cleanup: rename functions; avoid non-leading TABs

9 years agoMerge branch 'ls/p4-changes-block-size'
Junio C Hamano [Mon, 11 May 2015 21:23:46 +0000 (14:23 -0700)] 
Merge branch 'ls/p4-changes-block-size'

"git p4" learned "--changes-block-size <n>" to read the changes in
chunks from Perforce, instead of making one call to "p4 changes"
that may trigger "too many rows scanned" error from Perforce.

* ls/p4-changes-block-size:
  git-p4: use -m when running p4 changes

9 years agoMerge branch 'jc/plug-fmt-merge-msg-leak'
Junio C Hamano [Mon, 11 May 2015 21:23:45 +0000 (14:23 -0700)] 
Merge branch 'jc/plug-fmt-merge-msg-leak'

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

9 years agoMerge branch 'nd/slim-index-pack-memory-usage'
Junio C Hamano [Mon, 11 May 2015 21:23:44 +0000 (14:23 -0700)] 
Merge branch 'nd/slim-index-pack-memory-usage'

Memory usage of "git index-pack" has been trimmed by tens of
per-cent.

* nd/slim-index-pack-memory-usage:
  index-pack: kill union delta_base to save memory
  index-pack: reduce object_entry size to save memory

9 years agoMerge branch 'jk/still-interesting'
Junio C Hamano [Mon, 11 May 2015 21:23:43 +0000 (14:23 -0700)] 
Merge branch 'jk/still-interesting'

"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 'jk/reading-packed-refs'
Junio C Hamano [Mon, 11 May 2015 21:23:42 +0000 (14:23 -0700)] 
Merge branch 'jk/reading-packed-refs'

An earlier rewrite to use strbuf_getwholeline() instead of fgets(3)
to read packed-refs file revealed that the former is unacceptably
inefficient.

* jk/reading-packed-refs:
  t1430: add another refs-escape test
  read_packed_refs: avoid double-checking sane refs
  strbuf_getwholeline: use getdelim if it is available
  strbuf_getwholeline: avoid calling strbuf_grow
  strbuf_addch: avoid calling strbuf_grow
  config: use getc_unlocked when reading from file
  strbuf_getwholeline: use getc_unlocked
  git-compat-util: add fallbacks for unlocked stdio
  strbuf_getwholeline: use getc macro

9 years agoMerge branch 'lm/squelch-bg-progress'
Junio C Hamano [Mon, 11 May 2015 21:23:42 +0000 (14:23 -0700)] 
Merge branch 'lm/squelch-bg-progress'

Many long-running operations show progress eye-candy, even when
they are later backgrounded.  Hide the eye-candy when the process
is sent to the background instead.

* lm/squelch-bg-progress:
  compat/mingw: stubs for getpgid() and tcgetpgrp()
  progress: no progress in background

9 years agoMerge branch 'jk/sha1-file-reduce-useless-warnings'
Junio C Hamano [Mon, 11 May 2015 21:23:40 +0000 (14:23 -0700)] 
Merge branch 'jk/sha1-file-reduce-useless-warnings'

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

9 years agoMerge branch 'nd/multiple-work-trees'
Junio C Hamano [Mon, 11 May 2015 21:23:39 +0000 (14:23 -0700)] 
Merge branch 'nd/multiple-work-trees'

A replacement for contrib/workdir/git-new-workdir that does not
rely on symbolic links and make sharing of objects and refs safer
by making the borrowee and borrowers aware of each other.

* nd/multiple-work-trees: (41 commits)
  prune --worktrees: fix expire vs worktree existence condition
  t1501: fix test with split index
  t2026: fix broken &&-chain
  t2026 needs procondition SANITY
  git-checkout.txt: a note about multiple checkout support for submodules
  checkout: add --ignore-other-wortrees
  checkout: pass whole struct to parse_branchname_arg instead of individual flags
  git-common-dir: make "modules/" per-working-directory directory
  checkout: do not fail if target is an empty directory
  t2025: add a test to make sure grafts is working from a linked checkout
  checkout: don't require a work tree when checking out into a new one
  git_path(): keep "info/sparse-checkout" per work-tree
  count-objects: report unused files in $GIT_DIR/worktrees/...
  gc: support prune --worktrees
  gc: factor out gc.pruneexpire parsing code
  gc: style change -- no SP before closing parenthesis
  checkout: clean up half-prepared directories in --to mode
  checkout: reject if the branch is already checked out elsewhere
  prune: strategies for linked checkouts
  checkout: support checking out into a new working directory
  ...

9 years agoMerge branch 'pt/credential-xdg'
Junio C Hamano [Mon, 11 May 2015 21:23:38 +0000 (14:23 -0700)] 
Merge branch 'pt/credential-xdg'

Tweak the sample "store" backend of the credential helper to honor
XDG configuration file locations when specified.

* pt/credential-xdg:
  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 agorefs.c: remove lock_fd from struct ref_lock
Stefan Beller [Thu, 16 Apr 2015 23:17:37 +0000 (16:17 -0700)] 
refs.c: remove lock_fd from struct ref_lock

The 'lock_fd' is the same as 'lk->fd'. No need to store it twice so remove
it.

No functional changes intended.

Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommand-list.txt: fix whitespace inconsistency
Sébastien Guimmara [Fri, 8 May 2015 19:29:35 +0000 (21:29 +0200)] 
command-list.txt: fix whitespace inconsistency

The overwhelming majority of lines were single space aligned,
except a few ones aligned by tabs. Fix inconsistency by using
single space everywhere.

Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocontrib/subtree: portability fix for string printing
Danny Lin [Fri, 8 May 2015 00:56:59 +0000 (08:56 +0800)] 
contrib/subtree: portability fix for string printing

'echo -n' is not portable, but this script used it as a way to give
a string followed by a carriage return for progress messages.
Introduce a new helper shell function "progress" and use printf as a
more portable way to do this.  As a side effect, this makes it
unnecessary to have a raw CR in our source, which can be munged in
some shells.  For example, MsysGit trims CR before executing a shell
script file in order to make it work right on Windows even if it
uses CRLF as linefeeds.

While at it, replace "echo" using printf in debug() and say() to
eliminate the temptation of reintroducing the same bug.

Signed-off-by: Danny Lin <danny0838@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agohttp: add support for specifying an SSL cipher list
Lars Kellogg-Stedman [Fri, 8 May 2015 13:22:15 +0000 (09:22 -0400)] 
http: add support for specifying an SSL cipher list

Teach git about a new option, "http.sslCipherList", which permits one to
specify a list of ciphers to use when negotiating SSL connections.  The
setting can be overwridden by the GIT_SSL_CIPHER_LIST environment
variable.

Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agobundle: verify arguments more strictly
Patrick Steinhardt [Fri, 8 May 2015 08:02:00 +0000 (10:02 +0200)] 
bundle: verify arguments more strictly

The `verify` and `create` subcommands of the bundle builtin do
not properly verify the command line arguments that have been
passed in. While the `verify` subcommand accepts an arbitrary
amount of ignored arguments the `create` subcommand does not
complain about being passed too few arguments, resulting in a
bogus call to `git rev-list`. Fix these errors by verifying that
the correct amount of arguments has been passed in.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocontrib/subtree: there's no push --squash
Danny Lin [Thu, 7 May 2015 07:52:33 +0000 (15:52 +0800)] 
contrib/subtree: there's no push --squash

The documentation says that --squash is for 'add', 'merge',
'pull' and 'push', while --squash actually doesn't change
the behavior of 'push'. Correct the documentation.

Signed-off-by: Danny Lin <danny0838@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agotests: skip dav http-push tests under NO_EXPAT=NoThanks
Junio C Hamano [Thu, 7 May 2015 16:06:14 +0000 (09:06 -0700)] 
tests: skip dav http-push tests under NO_EXPAT=NoThanks

When built with NO_EXPAT=NoThanks, we will not have a working http-push
over webdav.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot/lib-httpd.sh: skip tests if NO_CURL is defined
Jeff King [Wed, 6 May 2015 17:42:29 +0000 (13:42 -0400)] 
t/lib-httpd.sh: skip tests if NO_CURL is defined

If we built git without curl, we can't actually test against
an http server. In fact, all of the test scripts which
include lib-httpd.sh already perform this check, with one
exception: t5540. For those scripts, this is a noop, and for
t5540, this is a bugfix (it used to fail when built with
NO_CURL, though it could go unnoticed if you had a stale
git-remote-https in your build directory).

Noticed-by: Junio C Hamano <junio@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocompletion: remove credential helpers from porcelain commands
SZEDER Gábor [Tue, 5 May 2015 16:33:13 +0000 (18:33 +0200)] 
completion: remove credential helpers from porcelain commands

Don't offer the "main" 'git credential' command or any of the credential
helpers from contrib/credential/ when completing git commands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot1006: add tests for git cat-file --allow-unknown-type
Karthik Nayak [Sun, 3 May 2015 14:30:02 +0000 (20:00 +0530)] 
t1006: add tests for git cat-file --allow-unknown-type

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocat-file: teach cat-file a '--allow-unknown-type' option
Karthik Nayak [Sun, 3 May 2015 14:30:01 +0000 (20:00 +0530)] 
cat-file: teach cat-file a '--allow-unknown-type' option

'git cat-file' throws an error while trying to print the type or
size of a broken/corrupt object. This is because these objects are
usually of unknown types.

Teach git cat-file a '--allow-unknown-type' option where it prints
the type or size of a broken/corrupt object without throwing
an error.

Modify '-t' and '-s' options to call sha1_object_info_extended()
directly to support the '--allow-unknown-type' option.

Add documentation for 'cat-file --allow-unknown-type'.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
cat-file: add documentation for '--allow-unknown-type' option.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocat-file: make the options mutually exclusive
Karthik Nayak [Sun, 3 May 2015 14:30:00 +0000 (20:00 +0530)] 
cat-file: make the options mutually exclusive

We only parse the options if 2 or 3 arguments are specified.
Update 'struct option options[]' to use OPT_CMDMODE rather than
OPT_SET_INT to allow only one mutually exclusive option and avoid the
need for checking number of arguments. This was written by Junio C Hamano,
tested by me.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosha1_file: support reading from a loose object of unknown type
Karthik Nayak [Sun, 3 May 2015 14:29:59 +0000 (19:59 +0530)] 
sha1_file: support reading from a loose object of unknown type

Update sha1_loose_object_info() to optionally allow it to read
from a loose object file of unknown/bogus type; as the function
usually returns the type of the object it read in the form of enum
for known types, add an optional "typename" field to receive the
name of the type in textual form and a flag to indicate the reading
of a loose object file of unknown/bogus type.

Add parse_sha1_header_extended() which acts as a wrapper around
parse_sha1_header() allowing more information to be obtained.

Add unpack_sha1_header_to_strbuf() to unpack sha1 headers of
unknown/corrupt objects which have a unknown sha1 header size to
a strbuf structure. This was written by Junio C Hamano but tested
by me.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Hepled-by: Jeff King <peff@peff.net>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agobranch: do not call a "remote-tracking branch" a "remote branch"
Danny Lin [Wed, 6 May 2015 19:01:55 +0000 (03:01 +0800)] 
branch: do not call a "remote-tracking branch" a "remote branch"

"git branch -r -d" mentions "delete remote branch", which should be
"remote-tracking branch".

Signed-off-by: Danny Lin <danny0838@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopath.c: remove home_config_paths()
Paul Tan [Wed, 6 May 2015 08:01:04 +0000 (16:01 +0800)] 
path.c: remove home_config_paths()

home_config_paths() combines distinct functionality already implemented
by expand_user_path() and xdg_config_home(), and it also hard-codes the
path ~/.gitconfig, which makes it unsuitable to use for other home
config file paths. Since its use will just add unnecessary complexity to
the code, remove it.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-config: replace use of home_config_paths()
Paul Tan [Wed, 6 May 2015 08:01:03 +0000 (16:01 +0800)] 
git-config: replace use of home_config_paths()

Since home_config_paths() combines distinct functionality already
implemented by expand_user_path() and xdg_config_home(), and hides the
home config file path ~/.gitconfig. Make the code more explicit by
replacing the use of home_config_paths() with expand_user_path() and
xdg_config_home().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-commit: replace use of home_config_paths()
Paul Tan [Wed, 6 May 2015 08:01:02 +0000 (16:01 +0800)] 
git-commit: replace use of home_config_paths()

Since home_config_paths() combines two distinct functionality already
implemented by expand_user_path() and xdg_config_home(), and hides the
home config file path ~/.gitconfig. Make the code more explicit by
replacing the use of home_config_paths() with expand_user_path() and
xdg_config_home().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocredential-store.c: replace home_config_paths() with xdg_config_home()
Paul Tan [Wed, 6 May 2015 08:01:01 +0000 (16:01 +0800)] 
credential-store.c: replace home_config_paths() with xdg_config_home()

Since only the xdg credentials file path is required, and
home_config_paths() is unable to construct the path ~/.git-credentials,
simplify the code by replacing home_config_paths() with
xdg_config_home().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>