Santiago Torres [Tue, 17 Jan 2017 23:37:20 +0000 (18:37 -0500)]
builtin/verify-tag: add --format to verify-tag
Callers of verify-tag may want to cross-check the tagname from refs/tags
with the tagname from the tag object header upon GPG verification. This
is to avoid tag refs that point to an incorrect object.
Add a --format parameter to git verify-tag to print the formatted tag
object header in addition to or instead of the --verbose or --raw GPG
verification output.
Signed-off-by: Santiago Torres <santiago@nyu.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lukas Puehringer [Tue, 17 Jan 2017 23:37:19 +0000 (18:37 -0500)]
ref-filter: add function to print single ref_array_item
ref-filter functions are useful for printing git object information
using a format specifier. However, some other modules may not want to use
this functionality on a ref-array but only print a single item.
Expose a pretty_print_ref function to create, pretty print and free
individual ref-items.
Signed-off-by: Lukas Puehringer <luk.puehringer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lukas Puehringer [Tue, 17 Jan 2017 23:37:18 +0000 (18:37 -0500)]
gpg-interface, tag: add GPG_VERIFY_OMIT_STATUS flag
Functions that print git object information may require that the
gpg-interface functions be silent. Add GPG_VERIFY_OMIT_STATUS flag and
prevent print_signature_buffer from being called if flag is set.
Signed-off-by: Lukas Puehringer <luk.puehringer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 29 Sep 2016 23:58:29 +0000 (16:58 -0700)]
Sync with maint
* maint:
Prepare for 2.10.1
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>
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
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
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
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
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
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>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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()
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()
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()
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
Junio C Hamano [Tue, 27 Sep 2016 06:49:39 +0000 (23:49 -0700)]
worktree: honor configuration variables
The command accesses default_abbrev (defined in environment.c and is
updated via core.abbrev configuration), but never makes any call to
git_config(). The output from "worktree list" ignores the abbrev
setting for this reason.
Make a call to git_config() to read the default set of configuration
variables at the beginning of the command.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 26 Sep 2016 23:11:46 +0000 (16:11 -0700)]
Fifth batch for 2.11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 26 Sep 2016 23:09:22 +0000 (16:09 -0700)]
Merge branch 'jk/clone-recursive-progress'
"git clone --recurse-submodules" lost the progress eye-candy in
recent update, which has been corrected.
* jk/clone-recursive-progress:
clone: pass --progress decision to recursive submodules
Junio C Hamano [Mon, 26 Sep 2016 23:09:22 +0000 (16:09 -0700)]
Merge branch 'jk/doc-cvs-update'
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
Junio C Hamano [Mon, 26 Sep 2016 23:09:21 +0000 (16:09 -0700)]
Merge branch 'rt/rebase-i-broken-insn-advise'
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
Junio C Hamano [Mon, 26 Sep 2016 23:09:21 +0000 (16:09 -0700)]
Merge branch 'rs/checkout-init-macro'
Code cleanup.
* rs/checkout-init-macro:
introduce CHECKOUT_INIT
Junio C Hamano [Mon, 26 Sep 2016 23:09:20 +0000 (16:09 -0700)]
Merge branch 'ls/travis-homebrew-path-fix'
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
Junio C Hamano [Mon, 26 Sep 2016 23:09:20 +0000 (16:09 -0700)]
Merge branch 'tg/add-chmod+x-fix'
"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
Junio C Hamano [Mon, 26 Sep 2016 23:09:19 +0000 (16:09 -0700)]
Merge branch 'js/regexec-buf'
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
Junio C Hamano [Mon, 26 Sep 2016 23:09:18 +0000 (16:09 -0700)]
Merge branch 'nd/checkout-disambiguation'
"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
Junio C Hamano [Mon, 26 Sep 2016 23:09:17 +0000 (16:09 -0700)]
Merge branch 'va/i18n-more'
Even more i18n.
* va/i18n-more:
i18n: stash: mark messages for translation
i18n: notes-merge: mark die messages for translation
i18n: ident: mark hint for translation
i18n: i18n: diff: mark die messages for translation
i18n: connect: mark die messages for translation
i18n: commit: mark message for translation
Junio C Hamano [Mon, 26 Sep 2016 23:09:17 +0000 (16:09 -0700)]
Merge branch 'jt/format-patch-rfc'
In some projects, it is common to use "[RFC PATCH]" as the subject
prefix for a patch meant for discussion rather than application. A
new option "--rfc" was a short-hand for "--subject-prefix=RFC PATCH"
to help the participants of such projects.
* jt/format-patch-rfc:
format-patch: add "--rfc" for the common case of [RFC PATCH]
Junio C Hamano [Mon, 26 Sep 2016 23:09:17 +0000 (16:09 -0700)]
Merge branch 'ep/doc-check-ref-format-example'
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
Junio C Hamano [Mon, 26 Sep 2016 23:09:16 +0000 (16:09 -0700)]
Merge branch 'mh/diff-indent-heuristic'
Output from "git diff" can be made easier to read by selecting
which lines are common and which lines are added/deleted
intelligently when the lines before and after the changed section
are the same. A command line option is added to help with the
experiment to find a good heuristics.
* mh/diff-indent-heuristic:
blame: honor the diff heuristic options and config
parse-options: add parse_opt_unknown_cb()
diff: improve positioning of add/delete blocks in diffs
xdl_change_compact(): introduce the concept of a change group
recs_match(): take two xrecord_t pointers as arguments
is_blank_line(): take a single xrecord_t as argument
xdl_change_compact(): only use heuristic if group can't be matched
xdl_change_compact(): fix compaction heuristic to adjust ixo
Junio C Hamano [Mon, 26 Sep 2016 23:09:15 +0000 (16:09 -0700)]
Merge branch 'rs/c-auto-resets-attributes'
The pretty-format specifier "%C(auto)" used by the "log" family of
commands to enable coloring of the output is taught to also issue a
color-reset sequence to the output.
* rs/c-auto-resets-attributes:
pretty: let %C(auto) reset all attributes
Junio C Hamano [Mon, 26 Sep 2016 23:09:14 +0000 (16:09 -0700)]
Merge branch 'mm/config-color-ui-default-to-auto'
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
Junio C Hamano [Mon, 26 Sep 2016 23:09:14 +0000 (16:09 -0700)]
Merge branch 'rs/cocci'
Code cleanup.
* rs/cocci:
use strbuf_addstr() for adding constant strings to a strbuf, part 2
add coccicheck make target
contrib/coccinelle: fix semantic patch for oid_to_hex_r()
Jonathan Tan [Fri, 23 Sep 2016 17:41:35 +0000 (10:41 -0700)]
fetch-pack: do not reset in_vain on non-novel acks
The MAX_IN_VAIN mechanism was introduced in commit
f061e5f ("fetch-pack:
give up after getting too many "ack continue"", 2006-05-24) to stop ref
negotiation if a number of consecutive "have"s have been sent with no
corresponding new acks. This is to stop the client from digging too deep
in an irrelevant side branch in vain without ever finding a common
ancestor. A use case (as described in that commit) is the scenario in
which the local repository has more roots than the remote repository.
However, during a negotiation in which stateless RPCs are used,
MAX_IN_VAIN will (almost) never trigger (in the more-roots scenario
above and others) because in each new request, the client has to inform
the server of objects it already has and knows the server has (to remind
the server of the state), which the server then acks.
Make fetch-pack only consider, as new acks for the purpose of
MAX_IN_VAIN, acks for objects for which the client has never received an
ack before in this session.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 23 Sep 2016 04:37:53 +0000 (00:37 -0400)]
ident: handle NULL ai_canonname
We call getaddrinfo() to try to convert a short hostname
into a fully-qualified one (to use it as an email domain).
If there isn't a canonical name, getaddrinfo() will
generally return either a NULL addrinfo list, or one in
which ai->ai_canonname is a copy of the original name.
However, if the result of gethostname() looks like an IP
address, then getaddrinfo() behaves differently on some
systems. On OS X, it will return a "struct addrinfo" with a
NULL ai_canonname, and we segfault feeding it to strchr().
This is hard to test reliably because it involves not only a
system where we we have to fallback to gethostname() to come
up with an ident, but also where the hostname is a number
with no dots. But I was able to replicate the bug by faking
a hostname, like:
diff --git a/ident.c b/ident.c
index
e20a772..
b790d28 100644
--- a/ident.c
+++ b/ident.c
@@ -128,6 +128,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
*is_bogus = 1;
return;
}
+ xsnprintf(buf, sizeof(buf), "1");
if (strchr(buf, '.'))
strbuf_addstr(out, buf);
else if (canonical_name(buf, out) < 0) {
and running "git var GIT_AUTHOR_IDENT" on an OS X system.
Before this patch it segfaults, and after we correctly
complain of the bogus "user@1.(none)" address (though this
bogus address would be suitable for non-object uses like
writing reflogs).
Reported-by: Jonas Thiel <jonas.lierschied@gmx.de>
Diagnosed-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Thu, 22 Sep 2016 16:11:33 +0000 (18:11 +0200)]
introduce CHECKOUT_INIT
Add a static initializer for struct checkout and use it throughout the
code base. It's shorter, avoids a memset(3) call and makes sure the
base_dir member is initialized to a valid (empty) string.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 22 Sep 2016 07:26:28 +0000 (03:26 -0400)]
docs/cvs-migration: mention cvsimport caveats
Back when this guide was written, cvsimport was the only
game in town. These days it is probably not the best option.
Rather than go into details, let's point people to the note
at the top of cvsimport which gives other options.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 22 Sep 2016 07:26:07 +0000 (03:26 -0400)]
docs/cvs-migration: update link to cvsps homepage
The old page gives a 404 now. Searching for "cvsps" via
Google returns a GitHub project page as the top hit.
Reported-by: Dan Pritts
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 22 Sep 2016 07:25:28 +0000 (03:25 -0400)]
docs/cvsimport: prefer cvs-fast-export to parsecvs
parsecvs maintenance was taken over by ESR, and the name
changed to cvs-fast-export as it learned to support that
output format. Let's point to cvs-fast-export, as it should
have additional bug-fixes and be more convenient to use.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 22 Sep 2016 05:24:46 +0000 (01:24 -0400)]
clone: pass --progress decision to recursive submodules
When cloning with "--recursive", we'd generally expect
submodules to show progress reports if the main clone did,
too.
In older versions of git, this mostly worked out of the
box. Since we show progress by default when stderr is a tty,
and since the child clones inherit the parent stderr, then
both processes would come to the same decision by default.
If the parent clone was asked for "--quiet", we passed down
"--quiet" to the child. However, if stderr was not a tty and
the user specified "--progress", we did not propagate this
to the child.
That's a minor bug, but things got much worse when we
switched recently to submodule--helper's update_clone
command. With that change, the stderr of the child clones
are always connected to a pipe, and we never output
progress at all.
This patch teaches git-submodule and git-submodule--helper
how to pass down an explicit "--progress" flag when cloning.
The clone command then decides to propagate that flag based
on the cloning decision made earlier (which takes into
account isatty(2) of the parent process, existing --progress
or --quiet flags, etc). Since the child processes always run
without a tty on stderr, we don't have to worry about
passing an explicit "--no-progress"; it's the default for
them.
This fixes the recent loss of progress during recursive
clones. And as a bonus, it makes:
git clone --recursive --progress ... 2>&1 | cat
work by triggering progress explicitly in the children.
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 22 Sep 2016 03:49:05 +0000 (23:49 -0400)]
verify_packfile: check pack validity before accessing data
The verify_packfile() does not explicitly open the packfile;
instead, it starts with a sha1 checksum over the whole pack,
and relies on use_pack() to open the packfile as a side
effect.
If the pack cannot be opened for whatever reason (either
because its header information is corrupted, or perhaps
because a simultaneous repack deleted it), then use_pack()
will die(), as it has no way to return an error. This is not
ideal, as verify_packfile() otherwise tries to gently return
an error (this lets programs like git-fsck go on to check
other packs).
Instead, let's check is_pack_valid() up front, and return an
error if it fails. This will open the pack as a side effect,
and then use_pack() will later rely on our cached
descriptor, and avoid calling die().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider [Wed, 21 Sep 2016 08:45:18 +0000 (10:45 +0200)]
travis-ci: ask homebrew for its path instead of hardcoding it
The TravisCI macOS build is broken because homebrew (a macOS dependency
manager) changed its internal directory structure [1]. This is a problem
because we modify the Perforce dependencies in the homebrew repository
before installing them.
Fix it by asking homebrew for its path instead of hardcoding it.
[1] https://github.com/Homebrew/brew/commit/
0a09ae30f8b6117ad699b4a0439010738989c547
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 21 Sep 2016 22:20:44 +0000 (15:20 -0700)]
Fourth batch for 2.11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 21 Sep 2016 22:15:29 +0000 (15:15 -0700)]
Merge branch 'jk/reduce-gc-aggressive-depth'
"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
Junio C Hamano [Wed, 21 Sep 2016 22:15:28 +0000 (15:15 -0700)]
Merge branch 'jk/rebase-i-drop-ident-check'
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
Junio C Hamano [Wed, 21 Sep 2016 22:15:28 +0000 (15:15 -0700)]
Merge branch 'va/i18n'
More i18n.
* va/i18n:
i18n: update-index: mark warnings for translation
i18n: show-branch: mark plural strings for translation
i18n: show-branch: mark error messages for translation
i18n: receive-pack: mark messages for translation
notes: spell first word of error messages in lowercase
i18n: notes: mark error messages for translation
i18n: merge-recursive: mark verbose message for translation
i18n: merge-recursive: mark error messages for translation
i18n: config: mark error message for translation
i18n: branch: mark option description for translation
i18n: blame: mark error messages for translation
Junio C Hamano [Wed, 21 Sep 2016 22:15:27 +0000 (15:15 -0700)]
Merge branch 'jt/format-patch-base-info-above-sig'
"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
Junio C Hamano [Wed, 21 Sep 2016 22:15:27 +0000 (15:15 -0700)]
Merge branch 'ks/perf-build-with-autoconf'
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
Junio C Hamano [Wed, 21 Sep 2016 22:15:27 +0000 (15:15 -0700)]
Merge branch 'mr/vcs-svn-printf-ulong'
Code cleanup.
* mr/vcs-svn-printf-ulong:
vcs-svn/fast_export: fix timestamp fmt specifiers
Junio C Hamano [Wed, 21 Sep 2016 22:15:26 +0000 (15:15 -0700)]
Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context'
"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
Junio C Hamano [Wed, 21 Sep 2016 22:15:26 +0000 (15:15 -0700)]
Merge branch 'rs/unpack-trees-reduce-file-scope-global'
Code cleanup.
* rs/unpack-trees-reduce-file-scope-global:
unpack-trees: pass checkout state explicitly to check_updates()
Junio C Hamano [Wed, 21 Sep 2016 22:15:25 +0000 (15:15 -0700)]
Merge branch 'rs/strbuf-remove-fix'
Code cleanup.
* rs/strbuf-remove-fix:
strbuf: use valid pointer in strbuf_remove()
Junio C Hamano [Wed, 21 Sep 2016 22:15:25 +0000 (15:15 -0700)]
Merge branch 'rs/pack-sort-with-llist-mergesort'
Code cleanup.
* rs/pack-sort-with-llist-mergesort:
sha1_file: use llist_mergesort() for sorting packs
Junio C Hamano [Wed, 21 Sep 2016 22:15:24 +0000 (15:15 -0700)]
Merge branch 'rs/checkout-some-states-are-const'
Code cleanup.
* rs/checkout-some-states-are-const:
checkout: constify parameters of checkout_stage() and checkout_merged()
Junio C Hamano [Wed, 21 Sep 2016 22:15:23 +0000 (15:15 -0700)]
Merge branch 'jk/setup-sequence-update'
There were numerous corner cases in which the configuration files
are read and used or not read at all depending on the directory a
Git command was run, leading to inconsistent behaviour. The code
to set-up repository access at the beginning of a Git process has
been updated to fix them.
* jk/setup-sequence-update:
t1007: factor out repeated setup
init: reset cached config when entering new repo
init: expand comments explaining config trickery
config: only read .git/config from configured repos
test-config: setup git directory
t1302: use "git -C"
pager: handle early config
pager: use callbacks instead of configset
pager: make pager_program a file-local static
pager: stop loading git_default_config()
pager: remove obsolete comment
diff: always try to set up the repository
diff: handle --no-index prefixes consistently
diff: skip implicit no-index check when given --no-index
patch-id: use RUN_SETUP_GENTLY
hash-object: always try to set up the git repository
Junio C Hamano [Wed, 21 Sep 2016 22:15:23 +0000 (15:15 -0700)]
Merge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle'
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
Junio C Hamano [Wed, 21 Sep 2016 22:15:22 +0000 (15:15 -0700)]
Merge branch 'bw/pathspec-remove-unused-extern-decl'
Code cleanup.
* bw/pathspec-remove-unused-extern-decl:
pathspec: remove unnecessary function prototypes
Junio C Hamano [Wed, 21 Sep 2016 22:15:21 +0000 (15:15 -0700)]
Merge branch 'ks/pack-objects-bitmap'
Some codepaths in "git pack-objects" were not ready to use an
existing pack bitmap; now they are and as the result they have
become faster.
* ks/pack-objects-bitmap:
pack-objects: use reachability bitmap index when generating non-stdout pack
pack-objects: respect --local/--honor-pack-keep/--incremental when bitmap is in use
Junio C Hamano [Wed, 21 Sep 2016 22:15:20 +0000 (15:15 -0700)]
Merge branch 'jk/patch-ids-no-merges'
"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
Junio C Hamano [Wed, 21 Sep 2016 22:15:20 +0000 (15:15 -0700)]
Merge branch 'jk/delta-base-cache'
Recently we updated the code to manage the in-core cache that holds
objects that have recently been used to reconstitute other objects
that are stored as deltas against them, but the update used an
incorrect API function to manage the list of these objects. This
has been fixed.
* jk/delta-base-cache:
add_delta_base_cache: use list_for_each_safe
Junio C Hamano [Wed, 21 Sep 2016 22:15:19 +0000 (15:15 -0700)]
Merge branch 'et/add-chmod-x'
"git add --chmod=+x" added recently lacked documentation, which has
been corrected.
* et/add-chmod-x:
add: document the chmod option
Junio C Hamano [Wed, 21 Sep 2016 22:15:18 +0000 (15:15 -0700)]
Merge branch 'js/cat-file-filters'
Even though "git hash-objects", which is a tool to take an
on-filesystem data stream and put it into the Git object store,
allowed to perform the "outside-world-to-Git" conversions (e.g.
end-of-line conversions and application of the clean-filter), and
it had the feature on by default from very early days, its reverse
operation "git cat-file", which takes an object from the Git object
store and externalize for the consumption by the outside world,
lacked an equivalent mechanism to run the "Git-to-outside-world"
conversion. The command learned the "--filters" option to do so.
* js/cat-file-filters:
cat-file: support --textconv/--filters in batch mode
cat-file --textconv/--filters: allow specifying the path separately
cat-file: introduce the --filters option
cat-file: fix a grammo in the man page
Junio C Hamano [Wed, 21 Sep 2016 22:15:17 +0000 (15:15 -0700)]
Merge branch 'jt/accept-capability-advertisement-when-fetching-from-void'
JGit can show a fake ref "capabilities^{}" to "git fetch" when it
does not advertise any refs, but "git fetch" was not prepared to
see such an advertisement. When the other side disconnects without
giving any ref advertisement, we used to say "there may not be a
repository at that URL", but we may have seen other advertisement
like "shallow" and ".have" in which case we definitely know that a
repository is there. The code to detect this case has also been
updated.
* jt/accept-capability-advertisement-when-fetching-from-void:
connect: advertized capability is not a ref
connect: tighten check for unexpected early hang up
tests: move test_lazy_prereq JGIT to test-lib.sh
Johannes Sixt [Tue, 20 Sep 2016 06:18:25 +0000 (08:18 +0200)]
t3700-add: do not check working tree file mode without POSIXPERM
A recently introduced test checks the result of 'git status' after
setting the executable bit on a file. This check does not yield the
expected result when the filesystem does not support the executable
bit.
What we care about is that a file added with "--chmod=+x" has
executable bit in the index and that "--chmod=+x" (or any other
options for that matter) does not muck with working tree files.
The former is tested by other existing tests, so let's check the
latter more explicitly and only under POSIXPERM prerequisite.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 21 Sep 2016 18:24:14 +0000 (20:24 +0200)]
regex: use regexec_buf()
The new regexec_buf() function operates on buffers with an explicitly
specified length, rather than NUL-terminated strings.
We need to use this function whenever the buffer we want to pass to
regexec(3) may have been mmap(2)ed (and is hence not NUL-terminated).
Note: the original motivation for this patch was to fix a bug where
`git diff -G <regex>` would crash. This patch converts more callers,
though, some of which allocated to construct NUL-terminated strings,
or worse, modified buffers to temporarily insert NULs while calling
regexec(3). By converting them to use regexec_buf(), the code has
become much cleaner.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 21 Sep 2016 18:24:04 +0000 (20:24 +0200)]
regex: add regexec_buf() that can work on a non NUL-terminated string
We just introduced a test that demonstrates that our sloppy use of
regexec() on a mmap()ed area can result in incorrect results or even
hard crashes.
So what we need to fix this is a function that calls regexec() on a
length-delimited, rather than a NUL-terminated, string.
Happily, there is an extension to regexec() introduced by the NetBSD
project and present in all major regex implementation including
Linux', MacOSX' and the one Git includes in compat/regex/: by using
the (non-POSIX) REG_STARTEND flag, it is possible to tell the
regexec() function that it should only look at the offsets between
pmatch[0].rm_so and pmatch[0].rm_eo.
That is exactly what we need.
Since support for REG_STARTEND is so widespread by now, let's just
introduce a helper function that always uses it, and tell people
on a platform whose regex library does not support it to use the
one from our compat/regex/ directory.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 21 Sep 2016 18:23:22 +0000 (20:23 +0200)]
regex: -G<pattern> feeds a non NUL-terminated string to regexec() and fails
When our pickaxe code feeds file contents to regexec(), it implicitly
assumes that the file contents are read into implicitly NUL-terminated
buffers (i.e. that we overallocate by 1, appending a single '\0').
This is not so.
In particular when the file contents are simply mmap()ed, we can be
virtually certain that the buffer is preceding uninitialized bytes, or
invalid pages.
Note that the test we add here is known to be flakey: we simply cannot
know whether the byte following the mmap()ed ones is a NUL or not.
Typically, on Linux the test passes. On Windows, it fails virtually
every time due to an access violation (that's a segmentation fault for
you Unix-y people out there). And Windows would be correct: the
regexec() call wants to operate on a regular, NUL-terminated string,
there is no NUL in the mmap()ed memory range, and it is undefined
whether the next byte is even legal to access.
When run with --valgrind it demonstrates quite clearly the breakage, of
course.
Being marked with `test_expect_failure`, this test will sometimes be
declare "TODO fixed", even if it only passes by mistake.
This test case represents a Minimal, Complete and Verifiable Example of
a breakage reported by Chris Sidi.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto [Tue, 20 Sep 2016 07:33:14 +0000 (07:33 +0000)]
git-check-ref-format.txt: fixup documentation
die is not a standard shell function. Use
a different shell code for the example.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt [Tue, 20 Sep 2016 06:16:11 +0000 (08:16 +0200)]
t3700-add: create subdirectory gently
The subdirectory 'sub' is created early in the test file. Later, a test
case removes it during its clean-up actions. However, this test case is
protected by POSIXPERM. Consequently, 'sub' remains when the POSIXPERM
prerequisite is not satisfied. Later, a recently introduced test case
creates 'sub' again. Use -p with mkdir so that it does not fail if 'sub'
already exists.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Tue, 20 Sep 2016 17:17:53 +0000 (10:17 -0700)]
mailinfo: handle in-body header continuations
Mailinfo currently handles multi-line headers, but it does not handle
multi-line in-body headers. Teach it to handle such headers, for
example, for this input:
From: author <author@example.com>
Date: Fri, 9 Jun 2006 00:44:16 -0700
Subject: a very long
broken line
Subject: another very long
broken line
interpret the in-body subject to be "another very long broken line"
instead of "another very long".
An existing test (t/t5100/msg0015) has an indented line immediately
after an in-body header - it has been modified to reflect the new
functionality.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vasco Almeida [Mon, 19 Sep 2016 13:08:21 +0000 (13:08 +0000)]
i18n: stash: mark messages for translation
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vasco Almeida [Mon, 19 Sep 2016 13:08:20 +0000 (13:08 +0000)]
i18n: notes-merge: mark die messages for translation
Update test to reflect changes.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vasco Almeida [Mon, 19 Sep 2016 13:08:19 +0000 (13:08 +0000)]
i18n: ident: mark hint for translation
Mark env_hint for translation.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël AVILA [Tue, 20 Sep 2016 19:04:27 +0000 (21:04 +0200)]
i18n: i18n: diff: mark die messages for translation
While marking individual messages for translation, consolidate some
messages "option 'foo' requires a value" that is used for many
options into one by introducing a helper function to die with the
message with the option name embedded in it, and ask the translators
to localize that single message instead.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Josh Triplett [Tue, 20 Sep 2016 04:23:25 +0000 (21:23 -0700)]
format-patch: add "--rfc" for the common case of [RFC PATCH]
Add an alias for --subject-prefix='RFC PATCH', which is used
commonly in some development communities to deserve such a
short-hand.
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Wed, 7 Sep 2016 11:19:41 +0000 (18:19 +0700)]
checkout: fix ambiguity check in subdir
The two functions in parse_branchname_arg(), verify_non_filename and
check_filename, need correct prefix in order to reconstruct the paths
and check for their existence. With NULL prefix, they just check paths
at top dir instead.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Wed, 7 Sep 2016 11:19:40 +0000 (18:19 +0700)]
checkout.txt: document a common case that ignores ambiguation rules
Normally we err on the safe side: if something can be seen as both an
SHA1 and a pathspec, we stop and scream. In checkout, there is one
exception added in
859fdab (git-checkout: improve error messages, detect
ambiguities. - 2008-07-23), to allow the common case "git checkout
branch". Let's document this exception.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Mon, 19 Sep 2016 21:08:52 +0000 (14:08 -0700)]
mailinfo: make is_scissors_line take plain char *
The is_scissors_line takes a struct strbuf * when a char * would
suffice. Make it take char *.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Mon, 19 Sep 2016 21:08:50 +0000 (14:08 -0700)]
mailinfo: separate in-body header processing
The check_header function contains logic specific to in-body headers,
although it is invoked during both the processing of actual headers and
in-body headers. Separate out the in-body header part into its own
function.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 19 Sep 2016 20:55:18 +0000 (13:55 -0700)]
Sync with maint
* maint:
Start preparing for 2.10.1
Junio C Hamano [Mon, 19 Sep 2016 20:54:50 +0000 (13:54 -0700)]
Start preparing for 2.10.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 19 Sep 2016 20:51:45 +0000 (13:51 -0700)]
Merge branch 'sb/diff-cleanup' into maint
Code cleanup.
* sb/diff-cleanup:
diff: remove dead code
diff: omit found pointer from emit_callback
diff.c: use diff_options directly