git
7 years agoMerge branch 'jk/clone-copy-alternates-fix'
Junio C Hamano [Mon, 17 Oct 2016 20:25:18 +0000 (13:25 -0700)] 
Merge branch 'jk/clone-copy-alternates-fix'

"git clone" of a local repository can be done at the filesystem
level, but the codepath did not check errors while copying and
adjusting the file that lists alternate object stores.

* jk/clone-copy-alternates-fix:
  clone: detect errors in normalize_path_copy

7 years agoMerge branch 'dt/http-empty-auth'
Junio C Hamano [Mon, 17 Oct 2016 20:25:18 +0000 (13:25 -0700)] 
Merge branch 'dt/http-empty-auth'

http.emptyauth configuration is a way to allow an empty username to
pass when attempting to authenticate using mechanisms like
Kerberos.  We took an unspecified (NULL) username and sent ":"
(i.e. no username, no password) to CURLOPT_USERPWD, but did not do
the same when the username is explicitly set to an empty string.

* dt/http-empty-auth:
  http: http.emptyauth should allow empty (not just NULL) usernames

7 years agoSync with maint
Junio C Hamano [Tue, 11 Oct 2016 21:55:48 +0000 (14:55 -0700)] 
Sync with maint

* maint:
  Start preparing for 2.10.2

7 years agoStart preparing for 2.10.2
Junio C Hamano [Tue, 11 Oct 2016 21:24:02 +0000 (14:24 -0700)] 
Start preparing for 2.10.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jk/verify-packfile-gently' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:21:35 +0000 (14:21 -0700)] 
Merge branch 'jk/verify-packfile-gently' into maint

A low-level function verify_packfile() was meant to show errors
that were detected without dying itself, but under some conditions
it didn't and died instead, which has been fixed.

* jk/verify-packfile-gently:
  verify_packfile: check pack validity before accessing data

7 years agoMerge branch 'jc/worktree-config' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:21:17 +0000 (14:21 -0700)] 
Merge branch 'jc/worktree-config' into maint

"git worktree", even though it used the default_abbrev setting that
ought to be affected by core.abbrev configuration variable, ignored
the variable setting.  The command has been taught to read the
default set of configuration variables to correct this.

* jc/worktree-config:
  worktree: honor configuration variables

7 years agoMerge branch 'jc/verify-loose-object-header' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:21:03 +0000 (14:21 -0700)] 
Merge branch 'jc/verify-loose-object-header' into maint

Codepaths that read from an on-disk loose object were too loose in
validating what they are reading is a proper object file and
sometimes read past the data they read from the disk, which has
been corrected.  H/t to Gustavo Grieco for reporting.

* jc/verify-loose-object-header:
  unpack_sha1_header(): detect malformed object header
  streaming: make sure to notice corrupt object

7 years agoMerge branch 'rs/git-gui-use-modern-git-merge-syntax' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:20:37 +0000 (14:20 -0700)] 
Merge branch 'rs/git-gui-use-modern-git-merge-syntax' into maint

The original command line syntax for "git merge", which was "git
merge <msg> HEAD <parent>...", has been deprecated for quite some
time, and "git gui" was the last in-tree user of the syntax.  This
is finally fixed, so that we can move forward with the deprecation.

* rs/git-gui-use-modern-git-merge-syntax:
  git-gui: stop using deprecated merge syntax

7 years agoMerge branch 'kd/mailinfo-quoted-string' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:20:31 +0000 (14:20 -0700)] 
Merge branch 'kd/mailinfo-quoted-string' into maint

An author name, that spelled a backslash-quoted double quote in the
human readable part "My \"double quoted\" name", was not unquoted
correctly while applying a patch from a piece of e-mail.

* kd/mailinfo-quoted-string:
  mailinfo: unescape quoted-pair in header fields
  t5100-mailinfo: replace common path prefix with variable

7 years agoMerge branch 'pb/rev-list-reverse-with-count' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:20:05 +0000 (14:20 -0700)] 
Merge branch 'pb/rev-list-reverse-with-count' into maint

Doc update to clarify what "log -3 --reverse" does.

* pb/rev-list-reverse-with-count:
  rev-list-options: clarify the usage of --reverse

7 years agoMerge branch 'jc/blame-abbrev' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:19:52 +0000 (14:19 -0700)] 
Merge branch 'jc/blame-abbrev' into maint

Almost everybody uses DEFAULT_ABBREV to refer to the default
setting for the abbreviation, but "git blame" peeked into
underlying variable bypassing the macro for no good reason.

* jc/blame-abbrev:
  blame: use DEFAULT_ABBREV macro

7 years agoMerge branch 'jk/graph-padding-fix' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:19:03 +0000 (14:19 -0700)] 
Merge branch 'jk/graph-padding-fix' into maint

The "graph" API used in "git log --graph" miscounted the number of
output columns consumed so far when drawing a padding line, which
has been fixed; this did not affect any existing code as nobody
tried to write anything after the padding on such a line, though.

* jk/graph-padding-fix:
  graph: fix extra spaces in graph_padding_line

7 years agoMerge branch 'sg/ref-filter-parse-optim' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:18:57 +0000 (14:18 -0700)] 
Merge branch 'sg/ref-filter-parse-optim' into maint

The code that parses the format parameter of for-each-ref command
has seen a micro-optimization.

* sg/ref-filter-parse-optim:
  ref-filter: strip format option after a field name only once while parsing

7 years agoMerge branch 'rs/copy-array' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:18:32 +0000 (14:18 -0700)] 
Merge branch 'rs/copy-array' into maint

Code cleanup.

* rs/copy-array:
  use COPY_ARRAY
  add COPY_ARRAY

7 years agoMerge branch 'dt/mailinfo' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:17:52 +0000 (14:17 -0700)] 
Merge branch 'dt/mailinfo' into maint

* dt/mailinfo:
  add David Turner's Two Sigma address

7 years agoNinth batch for 2.11
Junio C Hamano [Mon, 10 Oct 2016 21:09:12 +0000 (14:09 -0700)] 
Ninth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jc/blame-reverse'
Junio C Hamano [Mon, 10 Oct 2016 21:03:51 +0000 (14:03 -0700)] 
Merge branch 'jc/blame-reverse'

It is a common mistake to say "git blame --reverse OLD path",
expecting that the command line is dwimmed as if asking how lines
in path in an old revision OLD have survived up to the current
commit.

* jc/blame-reverse:
  blame: dwim "blame --reverse OLD" as "blame --reverse OLD.."
  blame: improve diagnosis for "--reverse NEW"

7 years agoMerge branch 'nd/shallow-deepen'
Junio C Hamano [Mon, 10 Oct 2016 21:03:50 +0000 (14:03 -0700)] 
Merge branch 'nd/shallow-deepen'

The existing "git fetch --depth=<n>" option was hard to use
correctly when making the history of an existing shallow clone
deeper.  A new option, "--deepen=<n>", has been added to make this
easier to use.  "git clone" also learned "--shallow-since=<date>"
and "--shallow-exclude=<tag>" options to make it easier to specify
"I am interested only in the recent N months worth of history" and
"Give me only the history since that version".

* nd/shallow-deepen: (27 commits)
  fetch, upload-pack: --deepen=N extends shallow boundary by N commits
  upload-pack: add get_reachable_list()
  upload-pack: split check_unreachable() in two, prep for get_reachable_list()
  t5500, t5539: tests for shallow depth excluding a ref
  clone: define shallow clone boundary with --shallow-exclude
  fetch: define shallow boundary with --shallow-exclude
  upload-pack: support define shallow boundary by excluding revisions
  refs: add expand_ref()
  t5500, t5539: tests for shallow depth since a specific date
  clone: define shallow clone boundary based on time with --shallow-since
  fetch: define shallow boundary with --shallow-since
  upload-pack: add deepen-since to cut shallow repos based on time
  shallow.c: implement a generic shallow boundary finder based on rev-list
  fetch-pack: use a separate flag for fetch in deepening mode
  fetch-pack.c: mark strings for translating
  fetch-pack: use a common function for verbose printing
  fetch-pack: use skip_prefix() instead of starts_with()
  upload-pack: move rev-list code out of check_non_tip()
  upload-pack: make check_non_tip() clean things up on error
  upload-pack: tighten number parsing at "deepen" lines
  ...

7 years agoMerge branch 'cp/completion-negative-refs'
Junio C Hamano [Mon, 10 Oct 2016 21:03:49 +0000 (14:03 -0700)] 
Merge branch 'cp/completion-negative-refs'

The command-line completion script (in contrib/) learned to
complete "git cmd ^mas<HT>" to complete the negative end of
reference to "git cmd ^master".

* cp/completion-negative-refs:
  completion: support excluding refs

7 years agoMerge branch 'dp/autoconf-curl-ssl'
Junio C Hamano [Mon, 10 Oct 2016 21:03:48 +0000 (14:03 -0700)] 
Merge branch 'dp/autoconf-curl-ssl'

The ./configure script generated from configure.ac was taught how
to detect support of SSL by libcurl better.

* dp/autoconf-curl-ssl:
  ./configure.ac: detect SSL in libcurl using curl-config

7 years agoMerge branch 'ak/curl-imap-send-explicit-scheme'
Junio C Hamano [Mon, 10 Oct 2016 21:03:47 +0000 (14:03 -0700)] 
Merge branch 'ak/curl-imap-send-explicit-scheme'

When we started cURL to talk to imap server when a new enough
version of cURL library is available, we forgot to explicitly add
imap(s):// before the destination.  To some folks, that didn't work
and the library tried to make HTTP(s) requests instead.

* ak/curl-imap-send-explicit-scheme:
  imap-send: Tell cURL to use imap:// or imaps://

7 years agoMerge branch 'jk/pack-objects-optim-mru'
Junio C Hamano [Mon, 10 Oct 2016 21:03:46 +0000 (14:03 -0700)] 
Merge branch 'jk/pack-objects-optim-mru'

"git pack-objects" in a repository with many packfiles used to
spend a lot of time looking for/at objects in them; the accesses to
the packfiles are now optimized by checking the most-recently-used
packfile first.

* jk/pack-objects-optim-mru:
  pack-objects: use mru list when iterating over packs
  pack-objects: break delta cycles before delta-search phase
  sha1_file: make packed_object_info public
  provide an initializer for "struct object_info"

7 years agoMerge branch 'rs/qsort'
Junio C Hamano [Mon, 10 Oct 2016 21:03:46 +0000 (14:03 -0700)] 
Merge branch 'rs/qsort'

We call "qsort(array, nelem, sizeof(array[0]), fn)", and most of
the time third parameter is redundant.  A new QSORT() macro lets us
omit it.

* rs/qsort:
  show-branch: use QSORT
  use QSORT, part 2
  coccicheck: use --all-includes by default
  remove unnecessary check before QSORT
  use QSORT
  add QSORT

7 years agoEighth batch for 2.11
Junio C Hamano [Thu, 6 Oct 2016 21:55:18 +0000 (14:55 -0700)] 
Eighth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'sg/ref-filter-parse-optim'
Junio C Hamano [Thu, 6 Oct 2016 21:53:12 +0000 (14:53 -0700)] 
Merge branch 'sg/ref-filter-parse-optim'

The code that parses the format parameter of for-each-ref command
has seen a micro-optimization.

* sg/ref-filter-parse-optim:
  ref-filter: strip format option after a field name only once while parsing

7 years agoMerge branch 'rs/cocci'
Junio C Hamano [Thu, 6 Oct 2016 21:53:12 +0000 (14:53 -0700)] 
Merge branch 'rs/cocci'

Code clean-up with help from coccinelle tool continues.

* rs/cocci:
  coccicheck: make transformation for strbuf_addf(sb, "...") more precise
  use strbuf_add_unique_abbrev() for adding short hashes, part 2
  use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
  gitignore: ignore output files of coccicheck make target

7 years agoMerge branch 'rs/c-auto-resets-attributes'
Junio C Hamano [Thu, 6 Oct 2016 21:53:12 +0000 (14:53 -0700)] 
Merge branch 'rs/c-auto-resets-attributes'

When "%C(auto)" appears at the very beginning of the pretty format
string, it did not need to issue the reset sequence, but it did.

* rs/c-auto-resets-attributes:
  pretty: avoid adding reset for %C(auto) if output is empty

7 years agoMerge branch 'ps/http-gssapi-cred-delegation'
Junio C Hamano [Thu, 6 Oct 2016 21:53:11 +0000 (14:53 -0700)] 
Merge branch 'ps/http-gssapi-cred-delegation'

In recent versions of cURL, GSSAPI credential delegation is
disabled by default due to CVE-2011-2192; introduce a configuration
to selectively allow enabling this.

* ps/http-gssapi-cred-delegation:
  http: control GSSAPI credential delegation

7 years agoMerge branch 'jk/graph-padding-fix'
Junio C Hamano [Thu, 6 Oct 2016 21:53:11 +0000 (14:53 -0700)] 
Merge branch 'jk/graph-padding-fix'

The "graph" API used in "git log --graph" miscounted the number of
output columns consumed so far when drawing a padding line, which
has been fixed; this did not affect any existing code as nobody
tried to write anything after the padding on such a line, though.

* jk/graph-padding-fix:
  graph: fix extra spaces in graph_padding_line

7 years agoMerge branch 'jc/blame-abbrev'
Junio C Hamano [Thu, 6 Oct 2016 21:53:10 +0000 (14:53 -0700)] 
Merge branch 'jc/blame-abbrev'

Almost everybody uses DEFAULT_ABBREV to refer to the default
setting for the abbreviation, but "git blame" peeked into
underlying variable bypassing the macro for no good reason.

* jc/blame-abbrev:
  blame: use DEFAULT_ABBREV macro

7 years agoMerge branch 'vn/revision-shorthand-for-side-branch-log'
Junio C Hamano [Thu, 6 Oct 2016 21:53:10 +0000 (14:53 -0700)] 
Merge branch 'vn/revision-shorthand-for-side-branch-log'

"git log rev^..rev" is an often-used revision range specification
to show what was done on a side branch merged at rev.  This has
gained a short-hand "rev^-1".  In general "rev^-$n" is the same as
"^rev^$n rev", i.e. what has happened on other branches while the
history leading to nth parent was looking the other way.

* vn/revision-shorthand-for-side-branch-log:
  revision: new rev^-n shorthand for rev^n..rev

7 years agoMerge branch 'jk/ambiguous-short-object-names'
Junio C Hamano [Thu, 6 Oct 2016 21:53:10 +0000 (14:53 -0700)] 
Merge branch 'jk/ambiguous-short-object-names'

When given an abbreviated object name that is not (or more
realistically, "no longer") unique, we gave a fatal error
"ambiguous argument".  This error is now accompanied by hints that
lists the objects that begins with the given prefix.  During the
course of development of this new feature, numerous minor bugs were
uncovered and corrected, the most notable one of which is that we
gave "short SHA1 xxxx is ambiguous." twice without good reason.

* jk/ambiguous-short-object-names:
  get_short_sha1: make default disambiguation configurable
  get_short_sha1: list ambiguous objects on error
  for_each_abbrev: drop duplicate objects
  sha1_array: let callbacks interrupt iteration
  get_short_sha1: mark ambiguity error for translation
  get_short_sha1: NUL-terminate hex prefix
  get_short_sha1: refactor init of disambiguation code
  get_short_sha1: parse tags when looking for treeish
  get_sha1: propagate flags to child functions
  get_sha1: avoid repeating ourselves via ONLY_TO_DIE
  get_sha1: detect buggy calls with multiple disambiguators

7 years agoclone: detect errors in normalize_path_copy
Jeff King [Wed, 5 Oct 2016 14:29:29 +0000 (10:29 -0400)] 
clone: detect errors in normalize_path_copy

When we are copying the alternates from the source
repository, if we find a relative path that is too deep for
the source (e.g., "../../../objects" from "/repo.git/objects"),
then normalize_path_copy will report an error and leave
trash in the buffer, which we will add to our new alternates
file. Instead, let's detect the error, print a warning, and
skip copying that alternate.

There's no need to die. The relative path is probably just
broken cruft in the source repo. If it turns out to have
been important for accessing some objects, we rely on other
parts of the clone to detect that, just as they would with a
missing object in the source repo itself (though note that
clones with "-s" are inherently local, which may do fewer
object-quality checks in the first place).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agohttp: http.emptyauth should allow empty (not just NULL) usernames
David Turner [Tue, 4 Oct 2016 14:53:52 +0000 (10:53 -0400)] 
http: http.emptyauth should allow empty (not just NULL) usernames

When using Kerberos authentication with newer versions of libcurl,
CURLOPT_USERPWD must be set to a value, even if it is an empty value.
The value is never sent to the server.  Previous versions of libcurl
did not require this variable to be set.  One way that some users
express the empty username/password is http://:@gitserver.example.com,
which http.emptyauth was designed to support.  Another, equivalent,
URL is http://@gitserver.example.com.  The latter leads to a username
of zero-length, rather than a NULL username, but CURLOPT_USERPWD still
needs to be set (if http.emptyauth is set).  Do so.

Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoSync with 2.10.1
Junio C Hamano [Mon, 3 Oct 2016 20:32:41 +0000 (13:32 -0700)] 
Sync with 2.10.1

* maint:
  Git 2.10.1

7 years agoSeventh batch for 2.11
Junio C Hamano [Mon, 3 Oct 2016 20:32:19 +0000 (13:32 -0700)] 
Seventh batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'pb/rev-list-reverse-with-count'
Junio C Hamano [Mon, 3 Oct 2016 20:30:39 +0000 (13:30 -0700)] 
Merge branch 'pb/rev-list-reverse-with-count'

Doc update to clarify what "log -3 --reverse" does.

* pb/rev-list-reverse-with-count:
  rev-list-options: clarify the usage of --reverse

7 years agoMerge branch 'dt/tree-fsck'
Junio C Hamano [Mon, 3 Oct 2016 20:30:38 +0000 (13:30 -0700)] 
Merge branch 'dt/tree-fsck'

The codepath in "git fsck" to detect malformed tree objects has
been updated not to die but keep going after detecting them.

* dt/tree-fsck:
  fsck: handle bad trees like other errors
  tree-walk: be more specific about corrupt tree errors

7 years agoMerge branch 'kd/mailinfo-quoted-string'
Junio C Hamano [Mon, 3 Oct 2016 20:30:38 +0000 (13:30 -0700)] 
Merge branch 'kd/mailinfo-quoted-string'

An author name, that spelled a backslash-quoted double quote in the
human readable part "My \"double quoted\" name", was not unquoted
correctly while applying a patch from a piece of e-mail.

* kd/mailinfo-quoted-string:
  mailinfo: unescape quoted-pair in header fields
  t5100-mailinfo: replace common path prefix with variable

7 years agoMerge branch 'mh/diff-indent-heuristic'
Junio C Hamano [Mon, 3 Oct 2016 20:30:38 +0000 (13:30 -0700)] 
Merge branch 'mh/diff-indent-heuristic'

Clean-up for a recently graduated topic.

* mh/diff-indent-heuristic:
  xdiff: rename "struct group" to "struct xdlgroup"

7 years agoMerge branch 'dt/mailinfo'
Junio C Hamano [Mon, 3 Oct 2016 20:30:37 +0000 (13:30 -0700)] 
Merge branch 'dt/mailinfo'

* dt/mailinfo:
  add David Turner's Two Sigma address

7 years agoMerge branch 'va/git-gui-i18n'
Junio C Hamano [Mon, 3 Oct 2016 20:30:37 +0000 (13:30 -0700)] 
Merge branch 'va/git-gui-i18n'

"git gui" l10n to Portuguese.

* va/git-gui-i18n:
  git-gui: l10n: add Portuguese translation
  git-gui i18n: mark strings for translation

7 years agoMerge branch 'rs/git-gui-use-modern-git-merge-syntax'
Junio C Hamano [Mon, 3 Oct 2016 20:30:36 +0000 (13:30 -0700)] 
Merge branch 'rs/git-gui-use-modern-git-merge-syntax'

The original command line syntax for "git merge", which was "git
merge <msg> HEAD <parent>...", has been deprecated for quite some
time, and "git gui" was the last in-tree user of the syntax.  This
is finally fixed, so that we can move forward with the deprecation.

* rs/git-gui-use-modern-git-merge-syntax:
  git-gui: stop using deprecated merge syntax

7 years agoMerge branch 'jc/verify-loose-object-header'
Junio C Hamano [Mon, 3 Oct 2016 20:30:36 +0000 (13:30 -0700)] 
Merge branch 'jc/verify-loose-object-header'

Codepaths that read from an on-disk loose object were too loose in
validating what they are reading is a proper object file and
sometimes read past the data they read from the disk, which has
been corrected.  H/t to Gustavo Grieco for reporting.

* jc/verify-loose-object-header:
  unpack_sha1_header(): detect malformed object header
  streaming: make sure to notice corrupt object

7 years agoMerge branch 'nd/init-core-worktree-in-multi-worktree-world'
Junio C Hamano [Mon, 3 Oct 2016 20:30:34 +0000 (13:30 -0700)] 
Merge branch 'nd/init-core-worktree-in-multi-worktree-world'

"git init" tried to record core.worktree in the repository's
'config' file when GIT_WORK_TREE environment variable was set and
it was different from where GIT_DIR appears as ".git" at its top,
but the logic was faulty when .git is a "gitdir:" file that points
at the real place, causing trouble in working trees that are
managed by "git worktree".  This has been corrected.

* nd/init-core-worktree-in-multi-worktree-world:
  init: kill git_link variable
  init: do not set unnecessary core.worktree
  init: kill set_git_dir_init()
  init: call set_git_dir_init() from within init_db()
  init: correct re-initialization from a linked worktree

7 years agoMerge branch 'ik/gitweb-force-highlight'
Junio C Hamano [Mon, 3 Oct 2016 20:30:33 +0000 (13:30 -0700)] 
Merge branch 'ik/gitweb-force-highlight'

"gitweb" can spawn "highlight" to show blob contents with
(programming) language-specific syntax highlighting, but only
when the language is known.  "highlight" can however be told
to make the guess itself by giving it "--force" option, which
has been enabled.

* ik/gitweb-force-highlight:
  gitweb: use highlight's shebang detection
  gitweb: remove unused guess_file_syntax() parameter

7 years agoMerge branch 'rs/copy-array'
Junio C Hamano [Mon, 3 Oct 2016 20:30:33 +0000 (13:30 -0700)] 
Merge branch 'rs/copy-array'

Code cleanup.

* rs/copy-array:
  use COPY_ARRAY
  add COPY_ARRAY

7 years agoGit 2.10.1 v2.10.1
Junio C Hamano [Mon, 3 Oct 2016 20:24:18 +0000 (13:24 -0700)] 
Git 2.10.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jk/ident-ai-canonname-could-be-null' into maint
Junio C Hamano [Mon, 3 Oct 2016 20:22:32 +0000 (13:22 -0700)] 
Merge branch 'jk/ident-ai-canonname-could-be-null' into maint

In the codepath that comes up with the hostname to be used in an
e-mail when the user didn't tell us, we looked at ai_canonname
field in struct addrinfo without making sure it is not NULL first.

* jk/ident-ai-canonname-could-be-null:
  ident: handle NULL ai_canonname

7 years agoMerge branch 'jk/doc-cvs-update' into maint
Junio C Hamano [Mon, 3 Oct 2016 20:22:25 +0000 (13:22 -0700)] 
Merge branch 'jk/doc-cvs-update' into maint

Documentation around tools to import from CVS was fairly outdated.

* jk/doc-cvs-update:
  docs/cvs-migration: mention cvsimport caveats
  docs/cvs-migration: update link to cvsps homepage
  docs/cvsimport: prefer cvs-fast-export to parsecvs

7 years agoMerge branch 'jk/pack-tag-of-tag' into maint
Junio C Hamano [Mon, 3 Oct 2016 20:22:13 +0000 (13:22 -0700)] 
Merge branch 'jk/pack-tag-of-tag' into maint

"git pack-objects --include-tag" was taught that when we know that
we are sending an object C, we want a tag B that directly points at
C but also a tag A that points at the tag B.  We used to miss the
intermediate tag B in some cases.

* jk/pack-tag-of-tag:
  pack-objects: walk tag chains for --include-tag
  t5305: simplify packname handling
  t5305: use "git -C"
  t5305: drop "dry-run" of unpack-objects
  t5305: move cleanup into test block

7 years agoref-filter: strip format option after a field name only once while parsing
SZEDER Gábor [Sun, 2 Oct 2016 16:35:11 +0000 (18:35 +0200)] 
ref-filter: strip format option after a field name only once while parsing

When parse_ref_filter_atom() iterates over a list of valid atoms to
check that a field name is one of them, it has to strip the optional
colon-separated format option suffix that might follow the field name.
However, it does so inside the loop, i.e. it performs the exact same
stripping over and over again.

Move stripping the format option suffix out of that loop, so it's only
performed once for each parsed field name.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoshow-branch: use QSORT
René Scharfe [Sat, 1 Oct 2016 16:19:48 +0000 (18:19 +0200)] 
show-branch: use QSORT

Shorten the code by using QSORT instead of calling qsort(3) directly,
as the former determines the element size automatically and checks if
there are at least two elements to sort already.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agococcicheck: make transformation for strbuf_addf(sb, "...") more precise
René Scharfe [Sun, 2 Oct 2016 22:58:21 +0000 (00:58 +0200)] 
coccicheck: make transformation for strbuf_addf(sb, "...") more precise

We can replace strbuf_addf() calls that just add a simple string with
calls to strbuf_addstr() to make the intent clearer.  We need to be
careful if that string contains printf format specifications like %%,
though, as a simple replacement would change the output.

Add checks to the semantic patch to make sure we only perform the
transformation if the second argument is a string constant (possibly
translated) that doesn't contain any percent signs.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agopretty: avoid adding reset for %C(auto) if output is empty
René Scharfe [Thu, 29 Sep 2016 18:13:05 +0000 (20:13 +0200)] 
pretty: avoid adding reset for %C(auto) if output is empty

We emit an escape sequence for resetting color and attribute for
%C(auto) to make sure automatic coloring is displayed as intended.
Stop doing that if the output strbuf is empty, i.e. when %C(auto)
appears at the start of the format string, because then there is no
need for a reset and we save a few bytes in the output.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agouse QSORT, part 2
René Scharfe [Thu, 29 Sep 2016 23:40:14 +0000 (01:40 +0200)] 
use QSORT, part 2

Convert two more qsort(3) calls to QSORT to reduce code size and for
better safety and consistency.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agococcicheck: use --all-includes by default
René Scharfe [Thu, 29 Sep 2016 23:21:17 +0000 (01:21 +0200)] 
coccicheck: use --all-includes by default

Add a make variable, SPATCH_FLAGS, for specifying flags for spatch, and
set it to --all-includes by default.  This option lets it consider
header files which would otherwise be ignored.  That's important for
some rules that rely on type information.  It doubles the duration of
coccicheck, however.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agohttp: control GSSAPI credential delegation
Petr Stodulka [Wed, 28 Sep 2016 18:01:34 +0000 (20:01 +0200)] 
http: control GSSAPI credential delegation

Delegation of credentials is disabled by default in libcurl since
version 7.21.7 due to security vulnerability CVE-2011-2192. Which
makes troubles with GSS/kerberos authentication when delegation
of credentials is required. This can be changed with option
CURLOPT_GSSAPI_DELEGATION in libcurl with set expected parameter
since libcurl version 7.22.0.

This patch provides new configuration variable http.delegation
which corresponds to curl parameter "--delegation" (see man 1 curl).

The following values are supported:

* none (default).
* policy
* always

Signed-off-by: Petr Stodulka <pstodulk@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoSync with maint
Junio C Hamano [Thu, 29 Sep 2016 23:58:29 +0000 (16:58 -0700)] 
Sync with maint

* maint:
  Prepare for 2.10.1

7 years agoSixth batch for 2.11
Junio C Hamano [Thu, 29 Sep 2016 23:58:20 +0000 (16:58 -0700)] 
Sixth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jc/worktree-config'
Junio C Hamano [Thu, 29 Sep 2016 23:57:14 +0000 (16:57 -0700)] 
Merge branch 'jc/worktree-config'

"git worktree", even though it used the default_abbrev setting that
ought to be affected by core.abbrev configuration variable, ignored
the variable setting.  The command has been taught to read the
default set of configuration variables to correct this.

* jc/worktree-config:
  worktree: honor configuration variables

7 years agoMerge branch 'jk/ident-ai-canonname-could-be-null'
Junio C Hamano [Thu, 29 Sep 2016 23:57:14 +0000 (16:57 -0700)] 
Merge branch 'jk/ident-ai-canonname-could-be-null'

In the codepath that comes up with the hostname to be used in an
e-mail when the user didn't tell us, we looked at ai_canonname
field in struct addrinfo without making sure it is not NULL first.

* jk/ident-ai-canonname-could-be-null:
  ident: handle NULL ai_canonname

7 years agoMerge branch 'jt/fetch-pack-in-vain-count-with-stateless'
Junio C Hamano [Thu, 29 Sep 2016 23:57:13 +0000 (16:57 -0700)] 
Merge branch 'jt/fetch-pack-in-vain-count-with-stateless'

When "git fetch" tries to find where the history of the repository
it runs in has diverged from what the other side has, it has a
mechanism to avoid digging too deep into irrelevant side branches.
This however did not work well over the "smart-http" transport due
to a design bug, which has been fixed.

* jt/fetch-pack-in-vain-count-with-stateless:
  fetch-pack: do not reset in_vain on non-novel acks

7 years agoMerge branch 'jk/verify-packfile-gently'
Junio C Hamano [Thu, 29 Sep 2016 23:57:13 +0000 (16:57 -0700)] 
Merge branch 'jk/verify-packfile-gently'

A low-level function verify_packfile() was meant to show errors
that were detected without dying itself, but under some conditions
it didn't and died instead, which has been fixed.

* jk/verify-packfile-gently:
  verify_packfile: check pack validity before accessing data

7 years agoMerge branch 'jt/mailinfo-fold-in-body-headers'
Junio C Hamano [Thu, 29 Sep 2016 23:57:12 +0000 (16:57 -0700)] 
Merge branch 'jt/mailinfo-fold-in-body-headers'

When "git format-patch --stdout" output is placed as an in-body
header and it uses the RFC2822 header folding, "git am" failed to
put the header line back into a single logical line.  The
underlying "git mailinfo" was taught to handle this properly.

* jt/mailinfo-fold-in-body-headers:
  mailinfo: handle in-body header continuations
  mailinfo: make is_scissors_line take plain char *
  mailinfo: separate in-body header processing

7 years agoPrepare for 2.10.1
Junio C Hamano [Thu, 29 Sep 2016 23:51:09 +0000 (16:51 -0700)] 
Prepare for 2.10.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'tg/add-chmod+x-fix' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:47 +0000 (16:49 -0700)] 
Merge branch 'tg/add-chmod+x-fix' into maint

"git add --chmod=+x <pathspec>" added recently only toggled the
executable bit for paths that are either new or modified. This has
been corrected to flip the executable bit for all paths that match
the given pathspec.

* tg/add-chmod+x-fix:
  t3700-add: do not check working tree file mode without POSIXPERM
  t3700-add: create subdirectory gently
  add: modify already added files when --chmod is given
  read-cache: introduce chmod_index_entry
  update-index: add test for chmod flags

7 years agoMerge branch 'et/add-chmod-x' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:46 +0000 (16:49 -0700)] 
Merge branch 'et/add-chmod-x' into maint

"git add --chmod=+x" added recently lacked documentation, which has
been corrected.

* et/add-chmod-x:
  add: document the chmod option

7 years agoMerge branch 'rt/rebase-i-broken-insn-advise' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:46 +0000 (16:49 -0700)] 
Merge branch 'rt/rebase-i-broken-insn-advise' into maint

When "git rebase -i" is given a broken instruction, it told the
user to fix it with "--edit-todo", but didn't say what the step
after that was (i.e. "--continue").

* rt/rebase-i-broken-insn-advise:
  rebase -i: improve advice on bad instruction lines

7 years agoMerge branch 'ls/travis-homebrew-path-fix' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:45 +0000 (16:49 -0700)] 
Merge branch 'ls/travis-homebrew-path-fix' into maint

The procedure to build Git on Mac OS X for Travis CI hardcoded the
internal directory structure we assumed HomeBrew uses, which was a
no-no.  The procedure has been updated to ask HomeBrew things we
need to know to fix this.

* ls/travis-homebrew-path-fix:
  travis-ci: ask homebrew for its path instead of hardcoding it

7 years agoMerge branch 'js/regexec-buf' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:44 +0000 (16:49 -0700)] 
Merge branch 'js/regexec-buf' into maint

Some codepaths in "git diff" used regexec(3) on a buffer that was
mmap(2)ed, which may not have a terminating NUL, leading to a read
beyond the end of the mapped region.  This was fixed by introducing
a regexec_buf() helper that takes a <ptr,len> pair with REG_STARTEND
extension.

* js/regexec-buf:
  regex: use regexec_buf()
  regex: add regexec_buf() that can work on a non NUL-terminated string
  regex: -G<pattern> feeds a non NUL-terminated string to regexec() and fails

7 years agoMerge branch 'nd/checkout-disambiguation' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:43 +0000 (16:49 -0700)] 
Merge branch 'nd/checkout-disambiguation' into maint

"git checkout <word>" does not follow the usual disambiguation
rules when the <word> can be both a rev and a path, to allow
checking out a branch 'foo' in a project that happens to have a
file 'foo' in the working tree without having to disambiguate.
This was poorly documented and the check was incorrect when the
command was run from a subdirectory.

* nd/checkout-disambiguation:
  checkout: fix ambiguity check in subdir
  checkout.txt: document a common case that ignores ambiguation rules
  checkout: add some spaces between code and comment

7 years agoMerge branch 'ep/doc-check-ref-format-example' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:43 +0000 (16:49 -0700)] 
Merge branch 'ep/doc-check-ref-format-example' into maint

A shell script example in check-ref-format documentation has been
fixed.

* ep/doc-check-ref-format-example:
  git-check-ref-format.txt: fixup documentation

7 years agoMerge branch 'mm/config-color-ui-default-to-auto' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:42 +0000 (16:49 -0700)] 
Merge branch 'mm/config-color-ui-default-to-auto' into maint

Documentation for individual configuration variables to control use
of color (like `color.grep`) said that their default value is
'false', instead of saying their default is taken from `color.ui`.
When we updated the default value for color.ui from 'false' to
'auto' quite a while ago, all of them broke.  This has been
corrected.

* mm/config-color-ui-default-to-auto:
  Documentation/config: default for color.* is color.ui

7 years agoMerge branch 'jk/reduce-gc-aggressive-depth' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:42 +0000 (16:49 -0700)] 
Merge branch 'jk/reduce-gc-aggressive-depth' into maint

"git gc --aggressive" used to limit the delta-chain length to 250,
which is way too deep for gaining additional space savings and is
detrimental for runtime performance.  The limit has been reduced to
50.

* jk/reduce-gc-aggressive-depth:
  gc: default aggressive depth to 50

7 years agoMerge branch 'jk/rebase-i-drop-ident-check' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:41 +0000 (16:49 -0700)] 
Merge branch 'jk/rebase-i-drop-ident-check' into maint

Even when "git pull --rebase=preserve" (and the underlying "git
rebase --preserve") can complete without creating any new commit
(i.e. fast-forwards), it still insisted on having a usable ident
information (read: user.email is set correctly), which was less
than nice.  As the underlying commands used inside "git rebase"
would fail with a more meaningful error message and advice text
when the bogus ident matters, this extra check was removed.

* jk/rebase-i-drop-ident-check:
  rebase-interactive: drop early check for valid ident

7 years agoMerge branch 'jt/format-patch-base-info-above-sig' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:40 +0000 (16:49 -0700)] 
Merge branch 'jt/format-patch-base-info-above-sig' into maint

"git format-patch --base=..." feature that was recently added
showed the base commit information after "-- " e-mail signature
line, which turned out to be inconvenient.  The base information
has been moved above the signature line.

* jt/format-patch-base-info-above-sig:
  format-patch: show base info before email signature

7 years agoMerge branch 'ks/perf-build-with-autoconf' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:40 +0000 (16:49 -0700)] 
Merge branch 'ks/perf-build-with-autoconf' into maint

Performance tests done via "t/perf" did not use the same set of
build configuration if the user relied on autoconf generated
configuration.

* ks/perf-build-with-autoconf:
  t/perf/run: copy config.mak.autogen & friends to build area

7 years agoMerge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:39 +0000 (16:49 -0700)] 
Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context' into maint

"git diff -W" output needs to extend the context backward to
include the header line of the current function and also forward to
include the body of the entire current function up to the header
line of the next one.  This process may have to merge to adjacent
hunks, but the code forgot to do so in some cases.

* rs/xdiff-merge-overlapping-hunks-for-W-context:
  xdiff: fix merging of hunks with -W context and -u context

7 years agoMerge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:39 +0000 (16:49 -0700)] 
Merge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle' into maint

The http transport (with curl-multi option, which is the default
these days) failed to remove curl-easy handle from a curlm session,
which led to unnecessary API failures.

* ew/http-do-not-forget-to-call-curl-multi-remove-handle:
  http: always remove curl easy from curlm session on release
  http: consolidate #ifdefs for curl_multi_remove_handle
  http: warn on curl_multi_add_handle failures

7 years agoMerge branch 'jk/patch-ids-no-merges' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)] 
Merge branch 'jk/patch-ids-no-merges' into maint

"git log --cherry-pick" used to include merge commits as candidates
to be matched up with other commits, resulting a lot of wasted time.
The patch-id generation logic has been updated to ignore merges to
avoid the wastage.

* jk/patch-ids-no-merges:
  patch-ids: refuse to compute patch-id for merge commit
  patch-ids: turn off rename detection

7 years agoMerge branch 'js/git-gui-commit-gpgsign' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)] 
Merge branch 'js/git-gui-commit-gpgsign' into maint

"git commit-tree" stopped reading commit.gpgsign configuration
variable that was meant for Porcelain "git commit" in Git 2.9; we
forgot to update "git gui" to look at the configuration to match
this change.

* js/git-gui-commit-gpgsign:
  git-gui: respect commit.gpgsign again

7 years agoMerge branch 'jk/fix-remote-curl-url-wo-proto' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)] 
Merge branch 'jk/fix-remote-curl-url-wo-proto' into maint

"git fetch http::/site/path" did not die correctly and segfaulted
instead.

* jk/fix-remote-curl-url-wo-proto:
  remote-curl: handle URLs without protocol

7 years agoMerge branch 'sy/git-gui-i18n-ja' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:37 +0000 (16:49 -0700)] 
Merge branch 'sy/git-gui-i18n-ja' into maint

Update Japanese translation for "git-gui".

* sy/git-gui-i18n-ja:
  git-gui: update Japanese information
  git-gui: update Japanese translation
  git-gui: add Japanese language code
  git-gui: apply po template to Japanese translation
  git-gui: consistently use the same word for "blame" in Japanese
  git-gui: consistently use the same word for "remote" in Japanese

7 years agoMerge branch 'mr/vcs-svn-printf-ulong' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:37 +0000 (16:49 -0700)] 
Merge branch 'mr/vcs-svn-printf-ulong' into maint

Code cleanup.

* mr/vcs-svn-printf-ulong:
  vcs-svn/fast_export: fix timestamp fmt specifiers

7 years agoMerge branch 'rs/unpack-trees-reduce-file-scope-global' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:36 +0000 (16:49 -0700)] 
Merge branch 'rs/unpack-trees-reduce-file-scope-global' into maint

Code cleanup.

* rs/unpack-trees-reduce-file-scope-global:
  unpack-trees: pass checkout state explicitly to check_updates()

7 years agoMerge branch 'rs/strbuf-remove-fix' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:35 +0000 (16:49 -0700)] 
Merge branch 'rs/strbuf-remove-fix' into maint

Code cleanup.

* rs/strbuf-remove-fix:
  strbuf: use valid pointer in strbuf_remove()

7 years agoMerge branch 'rs/checkout-some-states-are-const' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:35 +0000 (16:49 -0700)] 
Merge branch 'rs/checkout-some-states-are-const' into maint

Code cleanup.

* rs/checkout-some-states-are-const:
  checkout: constify parameters of checkout_stage() and checkout_merged()

7 years agoMerge branch 'bw/pathspec-remove-unused-extern-decl' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:34 +0000 (16:49 -0700)] 
Merge branch 'bw/pathspec-remove-unused-extern-decl' into maint

Code cleanup.

* bw/pathspec-remove-unused-extern-decl:
  pathspec: remove unnecessary function prototypes

7 years agograph: fix extra spaces in graph_padding_line
Jeff King [Thu, 29 Sep 2016 08:37:51 +0000 (04:37 -0400)] 
graph: fix extra spaces in graph_padding_line

The graph_padding_line() function outputs a series of "|"
columns, and then pads with spaces to graph->width by
calling graph_pad_horizontally(). However, we tell the
latter that we wrote graph->num_columns characters, which is
not true; we also needed spaces between the columns. Let's
keep a count of how many characters we've written, which is
what all the other callers of graph_pad_horizontally() do.

Without this, any output that is written at the end of a
padding line will be bumped out by at least an extra
graph->num_columns spaces. Presumably nobody ever noticed
the bug because there's no code path that actually writes to
the end of a padding line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoremove unnecessary check before QSORT
René Scharfe [Thu, 29 Sep 2016 15:29:29 +0000 (17:29 +0200)] 
remove unnecessary check before QSORT

Add a semantic patch for removing checks similar to the one that QSORT
already does internally and apply it to the code base.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agouse QSORT
René Scharfe [Thu, 29 Sep 2016 15:27:31 +0000 (17:27 +0200)] 
use QSORT

Apply the semantic patch contrib/coccinelle/qsort.cocci to the code
base, replacing calls of qsort(3) with QSORT.  The resulting code is
shorter and supports empty arrays with NULL pointers.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoadd QSORT
René Scharfe [Thu, 29 Sep 2016 15:23:43 +0000 (17:23 +0200)] 
add QSORT

Add the macro QSORT, a convenient wrapper for qsort(3) that infers the
size of the array elements and supports the convention of initializing
empty arrays with a NULL pointer, which we use in some places.

Calling qsort(3) directly with a NULL pointer is undefined -- even with
an element count of zero -- and allows the compiler to optimize away any
following NULL checks.  Using the macro avoids such surprises.

Add a semantic patch as well to demonstrate the macro's usage and to
automate the transformation of trivial cases.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoblame: use DEFAULT_ABBREV macro
Junio C Hamano [Wed, 28 Sep 2016 21:56:00 +0000 (14:56 -0700)] 
blame: use DEFAULT_ABBREV macro

This does not make any practical difference in today's code, but
everybody else accesses the default abbreviation length via the
DEFAULT_ABBREV macro.  Make sure this oddball codepath does not
stray from the convention.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomailinfo: unescape quoted-pair in header fields
Kevin Daudt [Wed, 28 Sep 2016 19:52:32 +0000 (21:52 +0200)] 
mailinfo: unescape quoted-pair in header fields

rfc2822 has provisions for quoted strings in structured header fields,
but also allows for escaping these with so-called quoted-pairs.

The only thing git currently does is removing exterior quotes, but
quotes within are left alone.

Remove exterior quotes and remove escape characters so that they don't
show up in the author field.

Signed-off-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agot5100-mailinfo: replace common path prefix with variable
Kevin Daudt [Wed, 28 Sep 2016 19:52:31 +0000 (21:52 +0200)] 
t5100-mailinfo: replace common path prefix with variable

Many tests need to store data in a file, and repeat the same pattern to
refer to that path:

    "$TEST_DIRECTORY"/t5100/

Create a variable that contains this path, and use that instead.

While we're making this change, make sure the quotes are not just around
the variable, but around the entire string to not give the impression
we want shell splitting to affect the other variables.

Signed-off-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agorev-list-options: clarify the usage of --reverse
Pranit Bauva [Tue, 27 Sep 2016 20:44:09 +0000 (20:44 +0000)] 
rev-list-options: clarify the usage of --reverse

Users often wonder if the oldest or the newest n commits are shown
by `log -n --reverse`.  Clarify that --reverse kicks in only after
deciding which commits are to be shown to unconfuse them.

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agofsck: handle bad trees like other errors
David Turner [Tue, 27 Sep 2016 20:59:51 +0000 (16:59 -0400)] 
fsck: handle bad trees like other errors

Instead of dying when fsck hits a malformed tree object, log the error
like any other and continue.  Now fsck can tell the user which tree is
bad, too.

Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agotree-walk: be more specific about corrupt tree errors
Jeff King [Tue, 27 Sep 2016 20:59:50 +0000 (16:59 -0400)] 
tree-walk: be more specific about corrupt tree errors

When the tree-walker runs into an error, it just calls
die(), and the message is always "corrupt tree file".
However, we are actually covering several cases here; let's
give the user a hint about what happened.

Let's also avoid using the word "corrupt", which makes it
seem like the data bit-rotted on disk. Our sha1 check would
already have found that. These errors are ones of data that
is malformed in the first place.

Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agouse strbuf_add_unique_abbrev() for adding short hashes, part 2
René Scharfe [Tue, 27 Sep 2016 19:11:58 +0000 (21:11 +0200)] 
use strbuf_add_unique_abbrev() for adding short hashes, part 2

Call strbuf_add_unique_abbrev() to add abbreviated hashes to strbufs
instead of taking detours through find_unique_abbrev() and its static
buffer.  This is shorter and a bit more efficient.

1eb47f167d65d1d305b9c196a1bb40eb96117cb1 already converted six cases,
this patch covers three more.

A semantic patch for Coccinelle is included for easier checking for
new cases that might be introduced in the future.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>