* Re: [PATCH v3 2/5] stash: introduce push verb
From: Thomas Gummerer @ 2017-02-11 13:33 UTC (permalink / raw)
To: Jeff King
Cc: git, Stephan Beyer, Junio C Hamano, Marc Strapetz,
Johannes Schindelin, Øyvind A . Holm, Jakub Narębski
In-Reply-To: <20170206154628.v27z5mqhxylz22ba@sigill.intra.peff.net>
[sorry for the late responses, life is keeping me busy]
On 02/06, Jeff King wrote:
> On Sun, Feb 05, 2017 at 08:26:39PM +0000, Thomas Gummerer wrote:
>
> > + -m|--message)
> > + shift
> > + stash_msg=${1?"-m needs an argument"}
> > + ;;
>
> I think this is our first use of the "?" parameter expansion magic. It
> _is_ in POSIX, so it may be fine. We may get complaints from people on
> weird shell variants, though. If that's the only reason to avoid it, I'd
> be inclined to try it and see, as it is much shorter.
>
> OTOH, most of the other usage errors call usage(), and this one doesn't.
> Nor is the error message translatable. Perhaps we should stick to the
> longer form (and add a helper function if necessary to reduce the
> boilerplate).
Yeah I do agree that calling usage is the better option here.
> > +save_stash () {
> > + push_options=
> > + while test $# != 0
> > + do
> > + case "$1" in
> > + --help)
> > + show_help
> > + ;;
> > + --)
> > + shift
> > + break
> > + ;;
> > + -*)
> > + # pass all options through to push_stash
> > + push_options="$push_options $1"
> > + ;;
> > + *)
> > + break
> > + ;;
> > + esac
> > + shift
> > + done
>
> I suspect you could just let "--help" get handled in the pass-through
> case (it generally takes precedence over errors found in other options,
> but I do not see any other parsing errors that could be found by this
> loop). It is not too bad to keep it, though (the important thing is that
> we're not duplicating all of the push_stash options here).
Good point, would be good to get rid of that duplication as well.
> > + if test -z "$stash_msg"
> > + then
> > + push_stash $push_options
> > + else
> > + push_stash $push_options -m "$stash_msg"
> > + fi
>
> Hmm. So $push_options is subject to word-splitting here. That's
> necessary to split the options back apart. It does the wrong thing if
> any of the options had spaces in them. But I don't think there are any
> valid options which do so, and "save" would presumably not grow any new
> options (they would go straight to "push").
>
> So there is a detectable behavior change:
>
> [before]
> $ git stash "--bogus option"
> error: unknown option for 'stash save': --bogus option
> To provide a message, use git stash save -- '--bogus option'
> [etc...]
>
> [after]
> $ git stash "--bogus option"
> error: unknown option for 'stash save': --bogus
> To provide a message, use git stash save -- '--bogus'
>
> but it's probably an acceptable casualty (the "right" way would be to
> shell-quote everything you stuff into $push_options and then eval the
> result when you invoke push_stash).
>
> Likewise, it's usually a mistake to just stick a new option (like "-m")
> after a list of unknown options. But it's OK here because we know we
> removed any "--" or non-option arguments.
>
> -Peff
--
Thomas
^ permalink raw reply
* Re: [PATCH v3 0/4] git gui: allow for a long recentrepo list
From: Philip Oakley @ 2017-02-11 12:48 UTC (permalink / raw)
To: GitList
Cc: Junio C Hamano, Pat Thoyts, Eric Sunshine, Alexey Astakhov,
Johannes Schindelin
In-Reply-To: <20170122195301.1784-1-philipoakley@iee.org>
Ping
Any comments anyone?
(https://public-inbox.org/git/20170122195301.1784-1-philipoakley@iee.org/)
I understand that the Git-for-Windows team is planning to include this in
their next release, so additional eyes are welcomed.
Philip
From: "Philip Oakley" <philipoakley@iee.org> date: Sunday, January 22, 2017
7:52 PM
> Way back in December 2015 I made a couple of attempts to patch up
> the git-gui's recentrepo list in the face of duplicate entries in
> the .gitconfig
>
> The series end at
> http://public-inbox.org/git/9731888BD4C348F5BFC82FA96D978034@PhilipOakley/
>
> A similar problem was reported recently on the Git for Windows list
> https://github.com/git-for-windows/git/issues/1014 were a full
> recentrepo list also stopped the gui working.
>
> This series applies to Pat Thoyt's upstream Github repo as a merge
> ready Pull Request https://github.com/patthoyts/git-gui/pull/10.
> Hence if applied here it should be into the sub-tree git/git-gui.
>
> I believe I've covered the points raised by Junio in the last review
> and allowed for cases where the recentrepo list is now longer than the
> maximum (which can be configured, both up and down).
>
> I've cc'd just the cover letter to those involved previously, rather
> than the series to avoid spamming.
>
> There are various other low hanging fruit that the eager could look at
> which are detailed at the end of the GfW/issues/104 referenced above.
>
> Philip Oakley (4):
> git-gui: remove duplicate entries from .gitconfig's gui.recentrepo
> git gui: cope with duplicates in _get_recentrepo
> git gui: de-dup selected repo from recentrepo history
> git gui: allow for a long recentrepo list
>
> lib/choose_repository.tcl | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> --
> 2.9.0.windows.1.323.g0305acf
> ---
> cc: Junio C Hamano <gitster@pobox.com>
> cc: Pat Thoyts <patthoyts@users.sourceforge.net>,
> cc: Eric Sunshine <sunshine@sunshineco.com>,
> cc: Alexey Astakhov <asstv7@gmail.com>
> cc: Johannes Schindelin <johannes.schindelin@gmx.de>
>
>
^ permalink raw reply
* Re: Non-zero exit code without error
From: Christian Couder @ 2017-02-11 12:28 UTC (permalink / raw)
To: Serdar Sahin; +Cc: git
In-Reply-To: <CAL7ZE5yXaJQFci+9aF4+cxeycnf71FMyLTV14t_TGDR3cnnfVA@mail.gmail.com>
On Wed, Feb 8, 2017 at 11:26 AM, Serdar Sahin <serdar@peakgames.net> wrote:
> Hi Christian,
>
>
> We are using a private repo (Github Enterprise).
Maybe you could try 'git fast-export --anonymize ...' on it.
> Let me give you the
> details you requested.
>
>
> On Git Server: git version 2.6.5.1574.g5e6a493
>
> On my client: git version 2.10.1 (Apple Git-78)
>
>
> I’ve tried to reproduce it with public repos, but couldn’t do so.
You might try using the latest released version (2.11.1).
For example you could install the last version on the client and then
clone from the server with --bare and use this bare repo as if it was
the server.
You could also try `git fsck` to see if there are problems on your repo.
Are there submodules or something a bit special?
In the end it's difficult for us to help if we cannot reproduce, so
your best bet might be to debug yourself using gdb for example.
> If I
> could get an error/log output, that would be sufficient.
>
>
> I am also including the full output below. (also git gc)
>
>
> MacOSX:test serdar$ git clone --mirror --depth 50 --no-single-branch
> git@git.privateserver.com:Casual/code_repository.git
You could also try with different options above...
> Cloning into bare repository 'code_repository.git'...
>
> remote: Counting objects: 3362, done.
>
> remote: Compressing objects: 100% (1214/1214), done.
>
> remote: Total 3362 (delta 2335), reused 2968 (delta 2094), pack-reused 0
>
> Receiving objects: 100% (3362/3362), 56.77 MiB | 1.83 MiB/s, done.
>
> Resolving deltas: 100% (2335/2335), done.
>
> MacOSX:test serdar$ cd code_repository.git/
>
> MacOSX:code_repository.git serdar$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git
> fetch --depth 50 origin cc086c96cdffe5c1ac78e6139a7a4b79e7c821ee
... and above.
Also it looks like you use ssh so something like GIT_SSH_COMMAND="ssh
-vv" might help more than GIT_CURL_VERBOSE=1
> 13:23:15.648337 git.c:350 trace: built-in: git 'fetch'
> '--depth' '50' 'origin' 'cc086c96cdffe5c1ac78e6139a7a4b79e7c821ee'
>
> 13:23:15.651127 run-command.c:336 trace: run_command: 'ssh'
> 'git@git.privateserver.com' 'git-upload-pack
> '\''Casual/code_repository.git'\'''
>
> 13:23:17.750015 run-command.c:336 trace: run_command: 'gc' '--auto'
>
> 13:23:17.750829 exec_cmd.c:189 trace: exec: 'git' 'gc' '--auto'
>
> 13:23:17.753983 git.c:350 trace: built-in: git 'gc' '--auto'
>
> MacOSX:code_repository.git serdar$ echo $?
>
> 1
>
> MacOSX:code_repository.git serdar$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git gc --auto
>
> 13:23:45.899038 git.c:350 trace: built-in: git 'gc' '--auto'
>
> MacOSX:code_repository.git serdar$ echo $?
>
> 0
^ permalink raw reply
* Re: [PATCH] mingw: use OpenSSL's SHA-1 routines
From: Johannes Sixt @ 2017-02-11 8:01 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git, Jeff Hostetler
In-Reply-To: <xmqqbmublyo0.fsf@gitster.mtv.corp.google.com>
Am 10.02.2017 um 00:41 schrieb Junio C Hamano:
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
>> From: Jeff Hostetler <jeffhost@microsoft.com>
>>
>> Use OpenSSL's SHA-1 routines rather than builtin block-sha1 routines.
>> This improves performance on SHA1 operations on Intel processors.
>> ...
>>
>> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>> ---
>
> Nice. Will queue as jh/mingw-openssl-sha1 topic; it is a bit too
> late for today's integration cycle to be merged to 'next', but let's
> have this by the end of the week in 'master'.
Please don't rush this through. I didn't have a chance to cross-check
the patch; it will have to wait for Monday. I would like to address
Peff's concerns about additional runtime dependencies.
-- Hannes
^ permalink raw reply
* Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision
From: Siddharth Kannan @ 2017-02-11 7:52 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Matthieu.Moy, pranit.bauva, peff, pclouds, sandals
In-Reply-To: <xmqqh941ippo.fsf@gitster.mtv.corp.google.com>
Hey Junio,
On Fri, Feb 10, 2017 at 03:35:47PM -0800, Junio C Hamano wrote:
> So the difference is just "--left" (by the way, our codebase seem to
> prefer "left--" when there is no difference between pre- or post-
> decrement/increment) that adjusts the slot in argv[] where the next
> unknown argument is stuffed to.
Understood, I will use post decrement.
> I am wondering if writing it like the following is easier to
> understand. I had a hard time figuring out what you are trying to
> do, partly because "args" is quite a misnomer---implying "how many
> arguments did we see" that is similar to opts that does mean "how
> many options did handle_revision_opts() see?"
Um, okay, I see that "args" is very confusing. Would it help if this variable
was called "arg_not_rev"? Because the value that is returned from
handle_revision_arg is 1 when it is not a revision, and 0 when it is a
revision. The changed block of code would look like this:
---
revision.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/revision.c b/revision.c
index b37dbec..4131ad5 100644
--- a/revision.c
+++ b/revision.c
@@ -2205,6 +2205,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
read_from_stdin = 0;
for (left = i = 1; i < argc; i++) {
const char *arg = argv[i];
+ int handle_rev_arg_called = 0, arg_not_rev;
if (*arg == '-') {
int opts;
@@ -2234,11 +2235,18 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
}
if (opts < 0)
exit(128);
- continue;
+
+ arg_not_rev = handle_revision_arg(arg, revs, flags, revarg_opt);
+ handle_rev_arg_called = 1;
+ if (arg_not_rev)
+ continue; /* arg is neither an option nor a revision */
+ else
+ left--; /* arg is a revision! */
}
- if (handle_revision_arg(arg, revs, flags, revarg_opt)) {
+ if ((handle_rev_arg_called && arg_not_rev) ||
+ handle_revision_arg(arg, revs, flags, revarg_opt)) {
> The rewrite below may avoid such a confusion. I dunno.
Um, I am sorry, but I feel that decrementing left, and incrementing it again is
also confusing. I think that with a better name for the return value from
handle_revision_arg, the earlier confusion should be resolved.
I base this on my previous experience following the codepath. It was easy for
me to understand with the previous code that "continue" will be executed from
within the first if block whenever arg begins with a "-" and it is determined
that it is not an option.
going by that, now, "continue" will be executed whenever it's not an option and
_also_ not an argument. Otherwise, the further parts of the code will execute
as before, and there are no continue statements there. I hope this argument
makes sense.
Also worth noting, The two `if` lines look better now:
1. If arg is not a revision, go to the next arg (because we have already
determined that it is not an option)
2. If handle_rev_arg was called AND the argument was not a revision, OR
if handle_revision_arg says that arg is not a rev, execute the following block.
Perhaps, someone else could please have a look at the changes in the block
above and the block below and give some feedback on which one is easier to
understand and the reason that they feel so. Thanks a lot!
>
> revision.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/revision.c b/revision.c
> index b37dbec378..e238430948 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -2204,6 +2204,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
> revarg_opt |= REVARG_CANNOT_BE_FILENAME;
> read_from_stdin = 0;
> for (left = i = 1; i < argc; i++) {
> + int maybe_rev = 0;
> const char *arg = argv[i];
> if (*arg == '-') {
> int opts;
> @@ -2234,11 +2235,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
> }
> if (opts < 0)
> exit(128);
> - continue;
> + maybe_rev = 1;
> + left--; /* tentatively cancel "unknown opt" */
> }
>
> -
> - if (handle_revision_arg(arg, revs, flags, revarg_opt)) {
> + if (!handle_revision_arg(arg, revs, flags, revarg_opt)) {
> + got_rev_arg = 1;
> + } else if (maybe_rev) {
> + left++; /* it turns out that it was "unknown opt" */
> + continue;
> + } else {
> int j;
> if (seen_dashdash || *arg == '^')
> die("bad revision '%s'", arg);
> @@ -2255,8 +2261,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
> append_prune_data(&prune_data, argv + i);
> break;
> }
> - else
> - got_rev_arg = 1;
> }
>
> if (prune_data.nr) {
Thanks Junio, for the time you spent analysing and writing the above version of
the patch!
Regards,
- Siddharth Kannan
^ permalink raw reply related
* Re: Google Doc about the Contributors' Summit
From: Junio C Hamano @ 2017-02-11 3:26 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.2.20.1702101658010.3496@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Technically, it is not a write-up, and I never meant it to be that. I
> intended this document to help me remember what had been discussed, and I
> doubt it is useful at all to anybody who has not been there.
>
> I abused the Git mailing list to share that link, what I really should
> have done is to use an URL shortener and jot the result down on the
> whiteboard.
>
> Very sorry for that,
Heh, no need to apologize.
I saw your <alpine.DEB.2.20.1702071248430.3496@virtualbox> that was
sent to the list long after the event, which obviously no longer
meant for collaborative note taking and thought that you are
inviting others to read the result of that note taking, and that is
why I commented on that. I've hopefully touched some "ask Junio
what he thinks of this" items and the whole thing was not wasted ;-)
^ permalink raw reply
* Re: What's cooking in git.git (Feb 2017, #03; Fri, 10)
From: Junio C Hamano @ 2017-02-11 3:12 UTC (permalink / raw)
To: René Scharfe; +Cc: git, Vegard Nossum
In-Reply-To: <77af28f3-7a8e-fc6a-40ae-c4203d1a3a67@web.de>
René Scharfe <l.s.r@web.de> writes:
> Am 10.02.2017 um 23:24 schrieb Junio C Hamano:
>> * vn/xdiff-func-context (2017-01-15) 1 commit
>> - xdiff -W: relax end-of-file function detection
>>
>> "git diff -W" has been taught to handle the case where a new
>> function is added at the end of the file better.
>>
>> Will hold.
>> Discussion on an follow-up change to go back from the line that
>> matches the funcline to show comments before the function
>> definition has not resulted in an actionable conclusion.
>
> This one is a bug fix and can be merged already IMHO.
Absolutely. I was just waiting if the follow-up discussion would
easily and quickly lead to another patch, forgot about what exactly
I was waiting for (i.e. the gravity of not having the follow-up),
and have left it in "Will hold" status forever.
Let's merge it to 'next' and then decide if we want to also merge it
to 'master' before the final. The above step alone is a lot less
contriversial and tricky bugfix.
Thanks.
^ permalink raw reply
* Re: fuzzy patch application
From: Junio C Hamano @ 2017-02-11 3:09 UTC (permalink / raw)
To: Nick Desaulniers; +Cc: Jeff King, Stefan Beller, git@vger.kernel.org
In-Reply-To: <CAKwvOdmvYiu4ApxL7jVh_0WZUMVeC2jJ4Q_Zs5Z5-J6GNH8DdQ@mail.gmail.com>
Nick Desaulniers <ndesaulniers@google.com> writes:
> For the dangers related to fuzzing, is there more info? I found
> and old post on this from Linus calling fuzzing dangerous but
> from what I could tell about my patch that wouldn't apply
> without fuzzing, the only difference in bad hunks was
> whitespace that had diverged somehow.
If the "old post" is the one he explains why he chose not to allow
fuzz by default, I think you got all what you need. Basically, he
wanted you and his users to make sure that the patch they are having
trouble with applying can be due to only insignificant difference
and it is safe to apply with reduced context, instead of blindly
accepting a fuzzy patch application.
^ permalink raw reply
* Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision
From: Junio C Hamano @ 2017-02-10 23:35 UTC (permalink / raw)
To: Siddharth Kannan; +Cc: git, Matthieu.Moy, pranit.bauva, peff, pclouds, sandals
In-Reply-To: <1486752926-12020-2-git-send-email-kannan.siddharth12@gmail.com>
Siddharth Kannan <kannan.siddharth12@gmail.com> writes:
> @@ -2234,11 +2235,18 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
> }
> if (opts < 0)
> exit(128);
> - continue;
> +
> + args = handle_revision_arg(arg, revs, flags, revarg_opt);
> + handle_rev_arg_called = 1;
> + if (args)
> + continue;
> + else
> + --left;
> }
>
>
> - if (handle_revision_arg(arg, revs, flags, revarg_opt)) {
> + if ((handle_rev_arg_called && args) ||
> + handle_revision_arg(arg, revs, flags, revarg_opt)) {
Naively I would have expected that removing the "continue" at the
end and letting the control go to the existing
if (handle_revision_arg(arg, revs, flags, revarg_opt)) {
would be all that is needed. The latter half of the patch is an
artifact of having ane xtra "handle_revision_arg() calls inside the
"if it begins with dash" block to avoid calling it twice.
So the difference is just "--left" (by the way, our codebase seem to
prefer "left--" when there is no difference between pre- or post-
decrement/increment) that adjusts the slot in argv[] where the next
unknown argument is stuffed to.
The adjustment is needed as the call to handle_revision_opt() that
is before the pre-context of this hunk stuffed the unknown thing
that begins with "-" into argv[left++]; if that thing turns out to
be a valid rev, then you would need to take it back, because after
all, that is not an unknown command line argument.
I am wondering if writing it like the following is easier to
understand. I had a hard time figuring out what you are trying to
do, partly because "args" is quite a misnomer---implying "how many
arguments did we see" that is similar to opts that does mean "how
many options did handle_revision_opts() see?" The variable means
means "yes we saw a valid rev" when it is zero. The rewrite
below may avoid such a confusion. I dunno.
revision.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/revision.c b/revision.c
index b37dbec378..e238430948 100644
--- a/revision.c
+++ b/revision.c
@@ -2204,6 +2204,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
revarg_opt |= REVARG_CANNOT_BE_FILENAME;
read_from_stdin = 0;
for (left = i = 1; i < argc; i++) {
+ int maybe_rev = 0;
const char *arg = argv[i];
if (*arg == '-') {
int opts;
@@ -2234,11 +2235,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
}
if (opts < 0)
exit(128);
- continue;
+ maybe_rev = 1;
+ left--; /* tentatively cancel "unknown opt" */
}
-
- if (handle_revision_arg(arg, revs, flags, revarg_opt)) {
+ if (!handle_revision_arg(arg, revs, flags, revarg_opt)) {
+ got_rev_arg = 1;
+ } else if (maybe_rev) {
+ left++; /* it turns out that it was "unknown opt" */
+ continue;
+ } else {
int j;
if (seen_dashdash || *arg == '^')
die("bad revision '%s'", arg);
@@ -2255,8 +2261,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
append_prune_data(&prune_data, argv + i);
break;
}
- else
- got_rev_arg = 1;
}
if (prune_data.nr) {
^ permalink raw reply related
* Re: What's cooking in git.git (Feb 2017, #03; Fri, 10)
From: René Scharfe @ 2017-02-10 23:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Vegard Nossum
In-Reply-To: <xmqq37flk7l4.fsf@gitster.mtv.corp.google.com>
Am 10.02.2017 um 23:24 schrieb Junio C Hamano:
> * vn/xdiff-func-context (2017-01-15) 1 commit
> - xdiff -W: relax end-of-file function detection
>
> "git diff -W" has been taught to handle the case where a new
> function is added at the end of the file better.
>
> Will hold.
> Discussion on an follow-up change to go back from the line that
> matches the funcline to show comments before the function
> definition has not resulted in an actionable conclusion.
This one is a bug fix and can be merged already IMHO.
I have raw patches for showing comments before functions with -W, but
they don't handle the case of a change being within such a comment.
We'd want to show the trailing function which it is referring to in such
a case, right?
And that's a bit tricky because it requires a more complicated model:
Currently we distinguish only between function lines and the rest, while
the new way would require identifying leading comment lines and probably
also trailing function body lines in addition to that, and neither can
be classified simply by looking at the line in question -- their type
depends on that of neighboring lines.
René
^ permalink raw reply
* Re: fuzzy patch application
From: Nick Desaulniers @ 2017-02-10 22:56 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Stefan Beller, git@vger.kernel.org
In-Reply-To: <xmqqlgtdiroz.fsf@gitster.mtv.corp.google.com>
It's not my call about the defaults, but users can be surprised by
such changes.
For the dangers related to fuzzing, is there more info? I found
and old post on this from Linus calling fuzzing dangerous but
from what I could tell about my patch that wouldn't apply
without fuzzing, the only difference in bad hunks was
whitespace that had diverged somehow.
On Fri, Feb 10, 2017 at 2:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Making "am -3" default may also scare users who are not exactly
>> comfortable with reading "git diff" output during a conflicted merge
>> and resolving a conflict, but other than that there shouldn't be any
>> downside.
>
> Another obvious downside is that there are those of us who prefer to
> run "am" without "-3" first to notice that the patch we expect to
> apply cleanly does apply cleanly, which gives us a chance to catch
> mistakes. I personally feel that as long as there is a configuration
> that makes -3 a personal default (with --no-3way override from the
> command line), it is a better design not to enable "-3" by default
> for everybody. New people can first learn using both forms and then
> after they got comfortable with resolving merges, they can choose to
> flip the default for themselves.
--
Thanks,
~Nick Desaulniers
^ permalink raw reply
* Re: fuzzy patch application
From: Junio C Hamano @ 2017-02-10 22:53 UTC (permalink / raw)
To: Jeff King; +Cc: Stefan Beller, Nick Desaulniers, git@vger.kernel.org
In-Reply-To: <xmqqy3xdisos.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> Making "am -3" default may also scare users who are not exactly
> comfortable with reading "git diff" output during a conflicted merge
> and resolving a conflict, but other than that there shouldn't be any
> downside.
Another obvious downside is that there are those of us who prefer to
run "am" without "-3" first to notice that the patch we expect to
apply cleanly does apply cleanly, which gives us a chance to catch
mistakes. I personally feel that as long as there is a configuration
that makes -3 a personal default (with --no-3way override from the
command line), it is a better design not to enable "-3" by default
for everybody. New people can first learn using both forms and then
after they got comfortable with resolving merges, they can choose to
flip the default for themselves.
^ permalink raw reply
* Re: [PATCH 2/2] ls-files: move only kept cache entries in prune_cache()
From: Brandon Williams @ 2017-02-10 22:51 UTC (permalink / raw)
To: René Scharfe; +Cc: Git List, Duy Nguyen, Junio C Hamano
In-Reply-To: <de84d0f4-cfce-1e73-6d5d-ad18df507d32@web.de>
On 02/10, René Scharfe wrote:
> prune_cache() first identifies those entries at the start of the sorted
> array that can be discarded. Then it moves the rest of the entries up.
> Last it identifies the unwanted trailing entries among the moved ones
> and cuts them off.
>
> Change the order: Identify both start *and* end of the range to keep
> first and then move only those entries to the top. The resulting code
> is slightly shorter and a bit more efficient.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
> The performance impact is probably only measurable with a *really* big
> index.
Well there's been a lot of talk recently about *really* big indexes, so
I'm sure someone out there will be happy :)
>
> builtin/ls-files.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/builtin/ls-files.c b/builtin/ls-files.c
> index 18105ec7ea..1c0f057d02 100644
> --- a/builtin/ls-files.c
> +++ b/builtin/ls-files.c
> @@ -379,10 +379,7 @@ static void prune_cache(const char *prefix, size_t prefixlen)
> pos = cache_name_pos(prefix, prefixlen);
> if (pos < 0)
> pos = -pos-1;
> - memmove(active_cache, active_cache + pos,
> - (active_nr - pos) * sizeof(struct cache_entry *));
> - active_nr -= pos;
> - first = 0;
> + first = pos;
> last = active_nr;
> while (last > first) {
> int next = (last + first) >> 1;
> @@ -393,7 +390,9 @@ static void prune_cache(const char *prefix, size_t prefixlen)
> }
> last = next;
> }
> - active_nr = last;
> + memmove(active_cache, active_cache + pos,
> + (last - pos) * sizeof(struct cache_entry *));
> + active_nr = last - pos;
> }
>
> /*
> --
> 2.11.1
>
Both these patches look good to me.
--
Brandon Williams
^ permalink raw reply
* Re: [PATCH] preload-index: avoid lstat for skip-worktree items
From: Junio C Hamano @ 2017-02-10 22:43 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Jeff Hostetler
In-Reply-To: <a1297b9426e7980f41e9e662fc0f30717c576c3e.1486739428.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> Teach preload-index to avoid lstat() calls for index-entries
> with skip-worktree bit set. This is a performance optimization.
> ...
> diff --git a/preload-index.c b/preload-index.c
> index c1fe3a3ef9c..70a4c808783 100644
> --- a/preload-index.c
> +++ b/preload-index.c
> @@ -53,6 +53,8 @@ static void *preload_thread(void *_data)
> continue;
> if (ce_uptodate(ce))
> continue;
> + if (ce_skip_worktree(ce))
> + continue;
> if (!ce_path_match(ce, &p->pathspec, NULL))
> continue;
> if (threaded_has_symlink_leading_path(&cache, ce->name, ce_namelen(ce)))
Because we are only interested in marking the ones that match
between the index and the working tree as "up-to-date", and we are
not doing the opposite (i.e. toggle "up-to-date" bit off by noticing
that things are now different) in this codepath, this change does
make sense. The ones marked as "skip", even if there were an
unrelated file or directory at the path where the index expects a
regular file, can be safely ignored.
Thanks.
^ permalink raw reply
* Re: [PATCH v2] git-p4: fix git-p4.pathEncoding for removed files
From: Junio C Hamano @ 2017-02-10 22:32 UTC (permalink / raw)
To: Luke Diamand; +Cc: Lars Schneider, Git Users
In-Reply-To: <CAE5ih78xRAOFb+MC53qzNJyZ_d7j+87UYEt5Ku6JrkFhgHdD7w@mail.gmail.com>
Luke Diamand <luke@diamand.org> writes:
> On 9 February 2017 at 23:39, Junio C Hamano <gitster@pobox.com> wrote:
>> Lars Schneider <larsxschneider@gmail.com> writes:
>>
>>> unfortunately, I missed to send this v2. I agree with Luke's review and
>>> I moved the re-encode of the path name to the `streamOneP4File` and
>>> `streamOneP4Deletion` explicitly.
>>>
>>> Discussion:
>>> http://public-inbox.org/git/CAE5ih7-=bD_ZoL5pFYfD2Qvy-XE24V_cgge0XoAvuoTK02EDfg@mail.gmail.com/
>>>
>>> Thanks,
>>> Lars
>>
>> Thanks. Will replace but will not immediately merge to 'next' yet,
>> just in case Luke wants to tell me add his "Reviewed-by:".
>
> Yes, this looks good to me now.
Thanks.
^ permalink raw reply
* Re: fuzzy patch application
From: Junio C Hamano @ 2017-02-10 22:31 UTC (permalink / raw)
To: Jeff King; +Cc: Stefan Beller, Nick Desaulniers, git@vger.kernel.org
In-Reply-To: <20170210214850.2ok62xdmemgotwnt@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I dunno. I always use it, but I'm not sure if there are any downsides,
> aside from a little extra processing time. It does have some
> incompatibilities with other options. And I think it kicks in rename
> detection (but I might be mis-remembering another feature). That could
> be surprising, I guess.
>
> The original dates all the way back to 47f0b6d5d (Fall back to three-way
> merge when applying a patch., 2005-10-06), but I don't see any rationale
> for not making it the default. Junio probably could give a better
> answer.
Nothing deep. Just being cautious by not to enable extra frills by
default, making it strictly o-p-t i-n. As that was a strict fall
back (i.e. there was no "if we are going to fall back, we need to
spend extra cycles to do this extra preparation before we attempt
the regular application"), extra-processing cost was not a concern,
at least back I wrote it the first time. I do not offhand know if
that still holds in the current one that was rewritten in C.
Making "am -3" default may also scare users who are not exactly
comfortable with reading "git diff" output during a conflicted merge
and resolving a conflict, but other than that there shouldn't be any
downside.
^ permalink raw reply
* What's cooking in git.git (Feb 2017, #03; Fri, 10)
From: Junio C Hamano @ 2017-02-10 22:24 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras, Pat Thoyts
Here are the topics that have been cooking. Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'. The ones marked with '.' do not appear in any of
the integration branches, but I am still holding onto them.
2.12-rc1 has been tagged and most of the big things are behind us (I
am reluctant to merge anything large-ish after -rc0 and that was why
-rc0 preview had topics that cooked in 'next' only for a few days
in---usually my rule is to keep any non-trivial topic for about a
week in 'next'). There still are interesting and/or exciting things
coming into 'next', hopefully they will be the "killer" additions
for the release after the upcoming 2.12. In the meantime, lets make
sure that we catch regressions in -rc1 and the tip of 'master'.
Oh, also I'd like to get pull requests for gitk and git-gui updates
soonish, if we are to have one during this cycle.
You can find the changes described here in the integration branches
of the repositories listed at
http://git-blame.blogspot.com/p/git-public-repositories.html
--------------------------------------------------
[Graduated to "master"]
* bw/push-submodule-only (2017-02-01) 2 commits
(merged to 'next' on 2017-02-06 at 851edafb14)
+ completion: add completion for --recurse-submodules=only
+ doc: add doc for git-push --recurse-submodules=only
Add missing documentation update to a recent topic.
* da/t7800-cleanup (2017-02-08) 2 commits
(merged to 'next' on 2017-02-10 at c983b65d33)
+ t7800: replace "wc -l" with test_line_count
+ Merge branch 'da/difftool-dir-diff-fix' into da/t7800-cleanup
(this branch uses js/difftool-builtin.)
Test updates.
* dl/difftool-doc-no-gui-option (2017-02-08) 1 commit
(merged to 'next' on 2017-02-10 at 3a3496a740)
+ Document the --no-gui option in difftool
Doc update.
* ew/complete-svn-authorship-options (2017-02-06) 1 commit
(merged to 'next' on 2017-02-06 at dca324db7c)
+ completion: fix git svn authorship switches
Correct command line completion (in contrib/) on "git svn"
* jk/log-graph-name-only (2017-02-08) 1 commit
(merged to 'next' on 2017-02-10 at 2ab7ed99f4)
+ diff: print line prefix for --name-only output
"git log --graph" did not work well with "--name-only", even though
other forms of "diff" output were handled correctly.
* jk/reset-to-break-a-commit-doc (2017-02-03) 1 commit
(merged to 'next' on 2017-02-06 at 7f571e62e9)
+ reset: add an example of how to split a commit into two
A minor doc update.
* js/difftool-builtin (2017-02-08) 2 commits
(merged to 'next' on 2017-02-10 at 30b3f383e8)
+ t7800: simplify basic usage test
(merged to 'next' on 2017-02-06 at 6a90549f38)
+ difftool: fix bug when printing usage
(this branch is used by da/t7800-cleanup.)
A few hot-fixes to C-rewrite of "git difftool".
* nd/rev-list-all-includes-HEAD-doc (2017-02-08) 1 commit
(merged to 'next' on 2017-02-10 at 5df8b81b57)
+ rev-list-options.txt: update --all about HEAD
Doc update.
* ps/worktree-prune-help-fix (2017-02-06) 1 commit
(merged to 'next' on 2017-02-06 at eeb96f1677)
+ worktree: fix option descriptions for `prune`
Incorrect usage help message for "git worktree prune" has been fixed.
* rs/fill-directory-optim (2017-02-08) 1 commit
(merged to 'next' on 2017-02-10 at 71047464df)
+ dir: avoid allocation in fill_directory()
Code clean-up.
* rs/p5302-create-repositories-before-tests (2017-02-06) 1 commit
(merged to 'next' on 2017-02-06 at f93bd2ed47)
+ p5302: create repositories for index-pack results explicitly
Adjust a perf test to new world order where commands that do
require a repository are really strict about having a repository.
--------------------------------------------------
[New Topics]
* jk/alternate-ref-optim (2017-02-08) 11 commits
(merged to 'next' on 2017-02-10 at f26f32cff6)
+ receive-pack: avoid duplicates between our refs and alternates
+ receive-pack: treat namespace .have lines like alternates
+ receive-pack: fix misleading namespace/.have comment
+ receive-pack: use oidset to de-duplicate .have lines
+ add oidset API
+ fetch-pack: cache results of for_each_alternate_ref
+ for_each_alternate_ref: replace transport code with for-each-ref
+ for_each_alternate_ref: pass name/oid instead of ref struct
+ for_each_alternate_ref: use strbuf for path allocation
+ for_each_alternate_ref: stop trimming trailing slashes
+ for_each_alternate_ref: handle failure from real_pathdup()
Optimizes resource usage while enumerating refs from alternate
object store, to help receiving end of "push" that hosts a
repository with many "forks".
Will cook in 'next'.
* lt/pathspec-negative (2017-02-10) 2 commits
(merged to 'next' on 2017-02-10 at 8ea7874076)
+ pathspec: don't error out on all-exclusionary pathspec patterns
+ pathspec magic: add '^' as alias for '!'
The "negative" pathspec feature was somewhat more cumbersome to use
than necessary in that its short-hand used "!" which needed to be
escaped from shells, and it required "exclude from what?" specified.
Will cook in 'next'.
* nd/worktree-gc-protection (2017-02-08) 2 commits
- worktree.c: use submodule interface to access refs from another worktree
- refs.c: add resolve_ref_submodule()
(hopefully) a beginning of safer "git worktree" that is resistant
to "gc".
Michael had a suggestion for a (hopefully) better alternative way
to do this. Expecting a reroll (either a tenative but quicker way,
or a better but slower way).
cf. <CACsJy8Diy92CNbJ1OBn893VFFrSsxBFWSyQHjt_Dzq9x7jfibQ@mail.gmail.com>
* sb/push-options-via-transport (2017-02-08) 1 commit
(merged to 'next' on 2017-02-10 at 3e2d08e1fa)
+ push options: pass push options to the transport helper
The push-options given via the "--push-options" option were not
passed through to external remote helpers such as "smart HTTP" that
are invoked via the transport helper.
Will merge to 'master'.
* js/rebase-helper (2017-02-09) 2 commits
- rebase -i: use the rebase--helper builtin
- rebase--helper: add a builtin helper for interactive rebases
"git rebase -i" starts using the recently updated "sequencer" code.
Will merge to and then cook in 'next'.
The change itself is small, but what it enables is rather a large
body of new code. We are getting there ;-)
* mh/submodule-hash (2017-02-10) 9 commits
- read_loose_refs(): read refs using resolve_ref_recursively()
- files_ref_store::submodule: use NULL for the main repository
- base_ref_store_init(): remove submodule argument
- refs: push the submodule attribute down
- refs: store submodule ref stores in a hashmap
- register_ref_store(): new function
- refs: remove some unnecessary handling of submodule == ""
- refs: make some ref_store lookup functions private
- refs: reorder some function definitions
Code and design clean-up for the refs API.
Will merge to and then cook in 'next'.
* jh/mingw-openssl-sha1 (2017-02-09) 1 commit
(merged to 'next' on 2017-02-10 at 084b3d8503)
+ mingw: use OpenSSL's SHA-1 routines
Windows port wants to use OpenSSL's implementation of SHA-1
routines, so let them.
Will merge to 'master'.
* sb/doc-unify-bottom (2017-02-09) 1 commit
(merged to 'next' on 2017-02-10 at 7229c4c1f7)
+ Documentation: unify bottom "part of git suite" lines
Doc clean-up.
Will merge to 'master'.
* dt/gc-ignore-old-gc-logs (2017-02-10) 2 commits
- SQUASH???
- gc: ignore old gc.log files
A "gc.log" file left by a backgrounded "gc --auto" disables further
automatic gc; it has been taught to run at least once a day (by
default) by ignoring a stale "gc.log" file that is too old.
Waiting for the discussion and reroll to quiet down (this one is v3
or so and I saw v5 posted).
* js/git-path-in-subdir (2017-02-10) 2 commits
- rev-parse: fix several options when running in a subdirectory
- rev-parse tests: add tests executed from a subdirectory
The "--git-path", "--git-common-dir", and "--shared-index-path"
options of "git rev-parse" did not produce usable output. They are
now updated to show the path to the correct file, relative to where
the caller is.
Waiting for Review/Ack.
cf. <cover.1486740772.git.johannes.schindelin@gmx.de>
--------------------------------------------------
[Stalled]
* vn/xdiff-func-context (2017-01-15) 1 commit
- xdiff -W: relax end-of-file function detection
"git diff -W" has been taught to handle the case where a new
function is added at the end of the file better.
Will hold.
Discussion on an follow-up change to go back from the line that
matches the funcline to show comments before the function
definition has not resulted in an actionable conclusion.
* pb/bisect (2016-10-18) 27 commits
- bisect--helper: remove the dequote in bisect_start()
- bisect--helper: retire `--bisect-auto-next` subcommand
- bisect--helper: retire `--bisect-autostart` subcommand
- bisect--helper: retire `--bisect-write` subcommand
- bisect--helper: `bisect_replay` shell function in C
- bisect--helper: `bisect_log` shell function in C
- bisect--helper: retire `--write-terms` subcommand
- bisect--helper: retire `--check-expected-revs` subcommand
- bisect--helper: `bisect_state` & `bisect_head` shell function in C
- bisect--helper: `bisect_autostart` shell function in C
- bisect--helper: retire `--next-all` subcommand
- bisect--helper: retire `--bisect-clean-state` subcommand
- bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C
- t6030: no cleanup with bad merge base
- bisect--helper: `bisect_start` shell function partially in C
- bisect--helper: `get_terms` & `bisect_terms` shell function in C
- bisect--helper: `bisect_next_check` & bisect_voc shell function in C
- bisect--helper: `check_and_set_terms` shell function in C
- bisect--helper: `bisect_write` shell function in C
- bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C
- bisect--helper: `bisect_reset` shell function in C
- wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()
- t6030: explicitly test for bisection cleanup
- bisect--helper: `bisect_clean_state` shell function in C
- bisect--helper: `write_terms` shell function in C
- bisect: rewrite `check_term_format` shell function in C
- bisect--helper: use OPT_CMDMODE instead of OPT_BOOL
Move more parts of "git bisect" to C.
Expecting a reroll.
cf. <CAFZEwPPXPPHi8KiEGS9ggzNHDCGhuqMgH9Z8-Pf9GLshg8+LPA@mail.gmail.com>
cf. <CAFZEwPM9RSTGN54dzaw9gO9iZmsYjJ_d1SjUD4EzSDDbmh-XuA@mail.gmail.com>
* ls/filter-process-delayed (2017-01-08) 1 commit
. convert: add "status=delayed" to filter process protocol
Ejected, as does not build when merged to 'pu'.
* sh/grep-tree-obj-tweak-output (2017-01-20) 2 commits
- grep: use '/' delimiter for paths
- grep: only add delimiter if there isn't one already
"git grep", when fed a tree-ish as an input, shows each hit
prefixed with "<tree-ish>:<path>:<lineno>:". As <tree-ish> is
almost always either a commit or a tag that points at a commit, the
early part of the output "<tree-ish>:<path>" can be used as the
name of the blob and given to "git show". When <tree-ish> is a
tree given in the extended SHA-1 syntax (e.g. "<commit>:", or
"<commit>:<dir>"), however, this results in a string that does not
name a blob (e.g. "<commit>::<path>" or "<commit>:<dir>:<path>").
"git grep" has been taught to be a bit more intelligent about these
cases and omit a colon (in the former case) or use slash (in the
latter case) to produce "<commit>:<path>" and
"<commit>:<dir>/<path>" that can be used as the name of a blob.
Waiting for the review discussion to settle, followed by a reroll.
* jc/diff-b-m (2015-02-23) 5 commits
. WIPWIP
. WIP: diff-b-m
- diffcore-rename: allow easier debugging
- diffcore-rename.c: add locate_rename_src()
- diffcore-break: allow debugging
"git diff -B -M" produced incorrect patch when the postimage of a
completely rewritten file is similar to the preimage of a removed
file; such a resulting file must not be expressed as a rename from
other place.
The fix in this patch is broken, unfortunately.
Will discard.
--------------------------------------------------
[Cooking]
* ls/p4-path-encoding (2017-02-09) 1 commit
- git-p4: fix git-p4.pathEncoding for removed files
When "git p4" imports changelist that removes paths, it failed to
convert pathnames when the p4 used encoding different from the one
used on the Git side. This has been corrected.
Waiting for Review/Ack.
cf. <20170209150656.9070-1-larsxschneider@gmail.com>
* mh/ref-remove-empty-directory (2017-01-07) 23 commits
(merged to 'next' on 2017-02-10 at bcfd359e95)
+ files_transaction_commit(): clean up empty directories
+ try_remove_empty_parents(): teach to remove parents of reflogs, too
+ try_remove_empty_parents(): don't trash argument contents
+ try_remove_empty_parents(): rename parameter "name" -> "refname"
+ delete_ref_loose(): inline function
+ delete_ref_loose(): derive loose reference path from lock
+ log_ref_write_1(): inline function
+ log_ref_setup(): manage the name of the reflog file internally
+ log_ref_write_1(): don't depend on logfile argument
+ log_ref_setup(): pass the open file descriptor back to the caller
+ log_ref_setup(): improve robustness against races
+ log_ref_setup(): separate code for create vs non-create
+ log_ref_write(): inline function
+ rename_tmp_log(): improve error reporting
+ rename_tmp_log(): use raceproof_create_file()
+ lock_ref_sha1_basic(): use raceproof_create_file()
+ lock_ref_sha1_basic(): inline constant
+ raceproof_create_file(): new function
+ safe_create_leading_directories(): set errno on SCLD_EXISTS
+ safe_create_leading_directories_const(): preserve errno
+ t5505: use "for-each-ref" to test for the non-existence of references
+ refname_is_safe(): correct docstring
+ files_rename_ref(): tidy up whitespace
Deletion of a branch "foo/bar" could remove .git/refs/heads/foo
once there no longer is any other branch whose name begins with
"foo/", but we didn't do so so far. Now we do.
Will cook in 'next'.
* cw/completion (2017-02-03) 7 commits
(merged to 'next' on 2017-02-10 at b3a5cbf39c)
+ completion: recognize more long-options
+ completion: teach remote subcommands to complete options
+ completion: teach replace to complete options
+ completion: teach ls-remote to complete options
+ completion: improve bash completion for git-add
+ completion: add subcommand completion for rerere
+ completion: teach submodule subcommands to complete options
More command line completion (in contrib/) for recent additions.
Will merge to 'master'.
* cw/tag-reflog-message (2017-02-08) 1 commit
(merged to 'next' on 2017-02-10 at 3968b3a58b)
+ tag: generate useful reflog message
"git tag", because refs/tags/* doesn't keep reflog by default, did
not leave useful message when adding a new entry to reflog.
Will cook in 'next'.
* sg/completion (2017-02-03) 21 commits
(merged to 'next' on 2017-02-10 at 55b2785d89)
+ completion: cache the path to the repository
+ completion: extract repository discovery from __gitdir()
+ completion: don't guard git executions with __gitdir()
+ completion: consolidate silencing errors from git commands
+ completion: don't use __gitdir() for git commands
+ completion: respect 'git -C <path>'
+ rev-parse: add '--absolute-git-dir' option
+ completion: fix completion after 'git -C <path>'
+ completion: don't offer commands when 'git --opt' needs an argument
+ completion: list short refs from a remote given as a URL
+ completion: don't list 'HEAD' when trying refs completion outside of a repo
+ completion: list refs from remote when remote's name matches a directory
+ completion: respect 'git --git-dir=<path>' when listing remote refs
+ completion: fix most spots not respecting 'git --git-dir=<path>'
+ completion: ensure that the repository path given on the command line exists
+ completion tests: add tests for the __git_refs() helper function
+ completion tests: check __gitdir()'s output in the error cases
+ completion tests: consolidate getting path of current working directory
+ completion tests: make the $cur variable local to the test helper functions
+ completion tests: don't add test cruft to the test repository
+ completion: improve __git_refs()'s in-code documentation
(this branch is used by sg/completion-refs-speedup.)
Clean-up and updates to command line completion (in contrib/).
Will merge to 'master'.
* sg/completion-refs-speedup (2017-02-06) 13 commits
- squash! completion: fill COMPREPLY directly when completing refs
- completion: fill COMPREPLY directly when completing refs
- completion: list only matching symbolic and pseudorefs when completing refs
- completion: let 'for-each-ref' sort remote branches for 'checkout' DWIMery
- completion: let 'for-each-ref' filter remote branches for 'checkout' DWIMery
- completion: let 'for-each-ref' strip the remote name from remote branches
- completion: let 'for-each-ref' and 'ls-remote' filter matching refs
- completion: don't disambiguate short refs
- completion: don't disambiguate tags and branches
- completion: support excluding full refs
- completion: support completing full refs after '--option=refs/<TAB>'
- completion: wrap __git_refs() for better option parsing
- completion: remove redundant __gitcomp_nl() options from _git_commit()
(this branch uses sg/completion.)
The refs completion for large number of refs has been sped up,
partly by giving up disambiguating ambiguous refs and partly by
eliminating most of the shell processing between 'git for-each-ref'
and 'ls-remote' and Bash's completion facility.
Will hold.
* sk/parse-remote-cleanup (2017-02-06) 1 commit
(merged to 'next' on 2017-02-06 at 6ec89f72d5)
+ parse-remote: remove reference to unused op_prep
Code clean-up.
Undecided. There may be third-party scripts that are dot-sourcing
this one.
* jk/delta-chain-limit (2017-01-27) 2 commits
(merged to 'next' on 2017-02-06 at 9ff36ae9b2)
+ pack-objects: convert recursion to iteration in break_delta_chain()
+ pack-objects: enforce --depth limit in reused deltas
"git repack --depth=<n>" for a long time busted the specified depth
when reusing delta from existing packs. This has been corrected.
Will cook in 'next'.
* mm/merge-rename-delete-message (2017-01-30) 1 commit
(merged to 'next' on 2017-02-10 at 8bf8146029)
+ merge-recursive: make "CONFLICT (rename/delete)" message show both paths
When "git merge" detects a path that is renamed in one history
while the other history deleted (or modified) it, it now reports
both paths to help the user understand what is going on in the two
histories being merged.
Will cook in 'next'.
* rs/swap (2017-01-30) 5 commits
(merged to 'next' on 2017-02-10 at 5253797d0a)
+ graph: use SWAP macro
+ diff: use SWAP macro
+ use SWAP macro
+ apply: use SWAP macro
+ add SWAP macro
Code clean-up.
Will merge to 'master'.
* ps/urlmatch-wildcard (2017-02-01) 5 commits
(merged to 'next' on 2017-02-10 at 2ed9ea48ee)
+ urlmatch: allow globbing for the URL host part
+ urlmatch: include host in urlmatch ranking
+ urlmatch: split host and port fields in `struct url_info`
+ urlmatch: enable normalization of URLs with globs
+ mailmap: add Patrick Steinhardt's work address
The <url> part in "http.<url>.<variable>" configuration variable
can now be spelled with '*' that serves as wildcard.
E.g. "http.https://*.example.com.proxy" can be used to specify the
proxy used for https://a.example.com, https://b.example.com, etc.,
i.e. any host in the example.com domain.
Will cook in 'next'.
* sf/putty-w-args (2017-02-10) 5 commits
- connect.c: stop conflating ssh command names and overrides
- connect: Add the envvar GIT_SSH_VARIANT and ssh.variant config
- git_connect(): factor out SSH variant handling
- connect: rename tortoiseplink and putty variables
- connect: handle putty/plink also in GIT_SSH_COMMAND
The command line options for ssh invocation needs to be tweaked for
some implementations of SSH (e.g. PuTTY plink wants "-P <port>"
while OpenSSH wants "-p <port>" to specify port to connect to), and
the variant was guessed when GIT_SSH environment variable is used
to specify it. Extend the guess to the command specified by the
newer GIT_SSH_COMMAND and also core.sshcommand configuration
variable, and give an escape hatch for users to deal with
misdetected cases.
Will merge to 'next' and then to 'master'.
* jk/describe-omit-some-refs (2017-01-23) 5 commits
(merged to 'next' on 2017-01-23 at f8a14b4996)
+ describe: teach describe negative pattern matches
+ describe: teach --match to accept multiple patterns
+ name-rev: add support to exclude refs by pattern match
+ name-rev: extend --refs to accept multiple patterns
+ doc: add documentation for OPT_STRING_LIST
"git describe" and "git name-rev" have been taught to take more
than one refname patterns to restrict the set of refs to base their
naming output on, and also learned to take negative patterns to
name refs not to be used for naming via their "--exclude" option.
Will cook in 'next'.
* sb/submodule-doc (2017-01-12) 2 commits
(merged to 'next' on 2017-02-10 at 5bfad5f30e)
+ submodule update documentation: don't repeat ourselves
+ submodule documentation: add options to the subcommand
Doc updates.
Will merge to 'master'.
* bw/attr (2017-02-01) 27 commits
- attr: reformat git_attr_set_direction() function
- attr: push the bare repo check into read_attr()
- attr: store attribute stack in attr_check structure
- attr: tighten const correctness with git_attr and match_attr
- attr: remove maybe-real, maybe-macro from git_attr
- attr: eliminate global check_all_attr array
- attr: use hashmap for attribute dictionary
- attr: change validity check for attribute names to use positive logic
- attr: pass struct attr_check to collect_some_attrs
- attr: retire git_check_attrs() API
- attr: convert git_check_attrs() callers to use the new API
- attr: convert git_all_attrs() to use "struct attr_check"
- attr: (re)introduce git_check_attr() and struct attr_check
- attr: rename function and struct related to checking attributes
- attr.c: outline the future plans by heavily commenting
- Documentation: fix a typo
- attr.c: add push_stack() helper
- attr: support quoting pathname patterns in C style
- attr.c: plug small leak in parse_attr_line()
- attr.c: tighten constness around "git_attr" structure
- attr.c: simplify macroexpand_one()
- attr.c: mark where #if DEBUG ends more clearly
- attr.c: complete a sentence in a comment
- attr.c: explain the lack of attr-name syntax check in parse_attr()
- attr.c: update a stale comment on "struct match_attr"
- attr.c: use strchrnul() to scan for one line
- commit.c: use strchrnul() to scan for one line
The gitattributes machinery is being taught to work better in a
multi-threaded environment.
Will merge to and then cook in 'next'.
* nd/worktree-move (2017-01-27) 7 commits
. fixup! worktree move: new command
. worktree remove: new command
. worktree move: refuse to move worktrees with submodules
. worktree move: accept destination as directory
. worktree move: new command
. worktree.c: add update_worktree_location()
. worktree.c: add validate_worktree()
"git worktree" learned move and remove subcommands.
Tentatively ejected as it seems to break 'pu' when merged.
* cc/split-index-config (2016-12-26) 21 commits
- Documentation/git-update-index: explain splitIndex.*
- Documentation/config: add splitIndex.sharedIndexExpire
- read-cache: use freshen_shared_index() in read_index_from()
- read-cache: refactor read_index_from()
- t1700: test shared index file expiration
- read-cache: unlink old sharedindex files
- config: add git_config_get_expiry() from gc.c
- read-cache: touch shared index files when used
- sha1_file: make check_and_freshen_file() non static
- Documentation/config: add splitIndex.maxPercentChange
- t1700: add tests for splitIndex.maxPercentChange
- read-cache: regenerate shared index if necessary
- config: add git_config_get_max_percent_split_change()
- Documentation/git-update-index: talk about core.splitIndex config var
- Documentation/config: add information for core.splitIndex
- t1700: add tests for core.splitIndex
- update-index: warn in case of split-index incoherency
- read-cache: add and then use tweak_split_index()
- split-index: add {add,remove}_split_index() functions
- config: add git_config_get_split_index()
- config: mark an error message up for translation
The experimental "split index" feature has gained a few
configuration variables to make it easier to use.
Waiting for review comments to be addressed.
cf. <20161226102222.17150-1-chriscool@tuxfamily.org>
cf. <a1a44640-ff6c-2294-72ac-46322eff8505@ramsayjones.plus.com>
* kn/ref-filter-branch-list (2017-02-07) 21 commits
(merged to 'next' on 2017-02-10 at 794bb8284d)
+ ref-filter: resurrect "strip" as a synonym to "lstrip"
(merged to 'next' on 2017-01-31 at e7592a5461)
+ branch: implement '--format' option
+ branch: use ref-filter printing APIs
+ branch, tag: use porcelain output
+ ref-filter: allow porcelain to translate messages in the output
+ ref-filter: add an 'rstrip=<N>' option to atoms which deal with refnames
+ ref-filter: modify the 'lstrip=<N>' option to work with negative '<N>'
+ ref-filter: Do not abruptly die when using the 'lstrip=<N>' option
+ ref-filter: rename the 'strip' option to 'lstrip'
+ ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()
+ ref-filter: introduce refname_atom_parser()
+ ref-filter: introduce refname_atom_parser_internal()
+ ref-filter: make "%(symref)" atom work with the ':short' modifier
+ ref-filter: add support for %(upstream:track,nobracket)
+ ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams
+ ref-filter: introduce format_ref_array_item()
+ ref-filter: move get_head_description() from branch.c
+ ref-filter: modify "%(objectname:short)" to take length
+ ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>)
+ ref-filter: include reference to 'used_atom' within 'atom_value'
+ ref-filter: implement %(if), %(then), and %(else) atoms
The code to list branches in "git branch" has been consolidated
with the more generic ref-filter API.
Will cook in 'next'.
* jk/no-looking-at-dotgit-outside-repo-final (2016-10-26) 1 commit
(merged to 'next' on 2016-12-05 at 0c77e39cd5)
+ setup_git_env: avoid blind fall-back to ".git"
Originally merged to 'next' on 2016-10-26
This is the endgame of the topic to avoid blindly falling back to
".git" when the setup sequence said we are _not_ in Git repository.
A corner case that happens to work right now may be broken by a
call to die("BUG").
Will cook in 'next'.
* jc/merge-drop-old-syntax (2015-04-29) 1 commit
(merged to 'next' on 2016-12-05 at 041946dae0)
+ merge: drop 'git merge <message> HEAD <commit>' syntax
Originally merged to 'next' on 2016-10-11
Stop supporting "git merge <message> HEAD <commit>" syntax that has
been deprecated since October 2007, and issues a deprecation
warning message since v2.5.0.
Will cook in 'next'.
* jc/bundle (2016-03-03) 6 commits
- index-pack: --clone-bundle option
- Merge branch 'jc/index-pack' into jc/bundle
- bundle v3: the beginning
- bundle: keep a copy of bundle file name in the in-core bundle header
- bundle: plug resource leak
- bundle doc: 'verify' is not about verifying the bundle
The beginning of "split bundle", which could be one of the
ingredients to allow "git clone" traffic off of the core server
network to CDN.
--------------------------------------------------
[Discarded]
* jk/nofollow-attr-ignore (2016-11-02) 5 commits
. exclude: do not respect symlinks for in-tree .gitignore
. attr: do not respect symlinks for in-tree .gitattributes
. exclude: convert "check_index" into a flags field
. attr: convert "macro_ok" into a flags field
. add open_nofollow() helper
As we do not follow symbolic links when reading control files like
.gitignore and .gitattributes from the index, match the behaviour
and not follow symbolic links when reading them from the working
tree. This also tightens security a bit by not leaking contents of
an unrelated file in the error messages when it is pointed at by
one of these files that is a symbolic link.
Perhaps we want to cover .gitmodules too with the same mechanism?
* sb/push-make-submodule-check-the-default (2017-01-26) 2 commits
(merged to 'next' on 2017-01-26 at 5f4715cea6)
+ Revert "push: change submodule default to check when submodules exist"
(merged to 'next' on 2016-12-12 at 1863e05af5)
+ push: change submodule default to check when submodules exist
Turn the default of "push.recurseSubmodules" to "check" when
submodules seem to be in use.
Retracted.
^ permalink raw reply
* Re: [PATCH v2] git-p4: fix git-p4.pathEncoding for removed files
From: Luke Diamand @ 2017-02-10 22:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Lars Schneider, Git Users
In-Reply-To: <xmqqfujnlyru.fsf@gitster.mtv.corp.google.com>
On 9 February 2017 at 23:39, Junio C Hamano <gitster@pobox.com> wrote:
> Lars Schneider <larsxschneider@gmail.com> writes:
>
>> unfortunately, I missed to send this v2. I agree with Luke's review and
>> I moved the re-encode of the path name to the `streamOneP4File` and
>> `streamOneP4Deletion` explicitly.
>>
>> Discussion:
>> http://public-inbox.org/git/CAE5ih7-=bD_ZoL5pFYfD2Qvy-XE24V_cgge0XoAvuoTK02EDfg@mail.gmail.com/
>>
>> Thanks,
>> Lars
>
> Thanks. Will replace but will not immediately merge to 'next' yet,
> just in case Luke wants to tell me add his "Reviewed-by:".
Yes, this looks good to me now.
Luke
^ permalink raw reply
* Re: fuzzy patch application
From: Jeff King @ 2017-02-10 21:48 UTC (permalink / raw)
To: Stefan Beller; +Cc: Junio C Hamano, Nick Desaulniers, git@vger.kernel.org
In-Reply-To: <CAGZ79kaG=oqDM=1+rz_zk6Qn-7wAszxPnBtqrkAJS29_qT7SoA@mail.gmail.com>
On Fri, Feb 10, 2017 at 01:37:12PM -0800, Stefan Beller wrote:
> > This is not exactly an answer to your question, but "git am -3" is often
> > a better solution than trying to fuzz patches. It assumes the patches
> > are Git patches (and record their origin blobs), and that you have that
> > blob (which should be true if the patches are based on the normal kernel
> > history, and you just fetch that history into your repository).
> >
> > I've found that this often manages to apply patches that "git apply"
> > will not by itself. And I also find the resulting conflicts to be much
> > easier to deal with than patch's ".rej" files.
>
> I have been told this a couple of times before; do we want to make -3
> the default (in 2.13 then) ?
I dunno. I always use it, but I'm not sure if there are any downsides,
aside from a little extra processing time. It does have some
incompatibilities with other options. And I think it kicks in rename
detection (but I might be mis-remembering another feature). That could
be surprising, I guess.
The original dates all the way back to 47f0b6d5d (Fall back to three-way
merge when applying a patch., 2005-10-06), but I don't see any rationale
for not making it the default. Junio probably could give a better
answer.
-Peff
^ permalink raw reply
* Re: [PATCH] squash! completion: fill COMPREPLY directly when completing refs
From: Junio C Hamano @ 2017-02-10 21:44 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: git
In-Reply-To: <20170206181545.12869-1-szeder.dev@gmail.com>
SZEDER Gábor <szeder.dev@gmail.com> writes:
> Care should be taken, though, because that prefix might contain
> 'for-each-ref' format specifiers as part of the left hand side of a
> '..' range or '...' symmetric difference notation or fetch/push/etc.
> refspec, e.g. 'git log "evil-%(refname)..br<TAB>'. Doubling every '%'
> in the prefix will prevent 'git for-each-ref' from interpolating any
> of those contained format specifiers.
> ---
>
> This is really pathological, and I'm sure this has nothing to do
> with whatever breakage Jacob experienced. The shell
> metacharacters '(' and ')' still cause us trouble in various ways,
> but that's nothing new and has been the case for quite a while
> (always?).
>
> It's already incorporated into (the rewritten)
>
> https://github.com/szeder/git completion-refs-speedup
Should I expect a reroll to come, or is this the only fix-up to the
series that begins at <20170203025405.8242-1-szeder.dev@gmail.com>?
No hurries.
^ permalink raw reply
* Re: fuzzy patch application
From: Stefan Beller @ 2017-02-10 21:37 UTC (permalink / raw)
To: Jeff King; +Cc: Nick Desaulniers, git@vger.kernel.org
In-Reply-To: <20170210205749.c72ajnld7zjfjkwj@sigill.intra.peff.net>
On Fri, Feb 10, 2017 at 12:57 PM, Jeff King <peff@peff.net> wrote:
> On Fri, Feb 10, 2017 at 11:20:59AM -0800, Nick Desaulniers wrote:
>
>> I frequently need to backport patches from the Linux kernel to older
>> kernel versions (Android Security). My usual workflow for simple
>> patches is:
>>
>> 1. try `git am patch.txt`.
>
> This is not exactly an answer to your question, but "git am -3" is often
> a better solution than trying to fuzz patches. It assumes the patches
> are Git patches (and record their origin blobs), and that you have that
> blob (which should be true if the patches are based on the normal kernel
> history, and you just fetch that history into your repository).
>
> I've found that this often manages to apply patches that "git apply"
> will not by itself. And I also find the resulting conflicts to be much
> easier to deal with than patch's ".rej" files.
>
> -Peff
I have been told this a couple of times before; do we want to make -3
the default (in 2.13 then) ?
^ permalink raw reply
* Re: [PATCH v5] gc: ignore old gc.log files
From: Jeff King @ 2017-02-10 21:32 UTC (permalink / raw)
To: David Turner; +Cc: git@vger.kernel.org, pclouds@gmail.com, Junio C Hamano
In-Reply-To: <069b229470204235b7155b33da52421c@exmbdft7.ad.twosigma.com>
On Fri, Feb 10, 2017 at 09:23:15PM +0000, David Turner wrote:
> > Speaking of stderr, I wonder if this function should be calling
> > fflush(stderr) before looking at the fstat result. There could be contents buffered
> > there that haven't been written out yet (not from child processes, but perhaps
> > ones written in this process itself).
> > Probably unlikely in practice, since stderr is typically unbuffered by default.
>
> Process_log_file_at_exit calls fflush. Will fix the other.
Ah, good. That makes sense, since we might deadlock if we do it in a
signal handler. Perhaps that is a reason not to use stderr here again
(though if we want to be that careful, a new fdopen() call is also a bad
idea, as we can deadlock over the malloc() lock; you'd have to snprintf
to a small buffer and dump it with write()).
-Peff
^ permalink raw reply
* RE: [PATCH v5] gc: ignore old gc.log files
From: David Turner @ 2017-02-10 21:23 UTC (permalink / raw)
To: 'Jeff King'
Cc: git@vger.kernel.org, pclouds@gmail.com, Junio C Hamano
In-Reply-To: <20170210211510.zbustcl5ickfiqdy@sigill.intra.peff.net>
> -----Original Message-----
> From: Jeff King [mailto:peff@peff.net]
> Sent: Friday, February 10, 2017 4:15 PM
> To: David Turner <David.Turner@twosigma.com>
> Cc: git@vger.kernel.org; pclouds@gmail.com; Junio C Hamano
> <gitster@pobox.com>
> Subject: Re: [PATCH v5] gc: ignore old gc.log files
>
> > @@ -76,10 +78,30 @@ static void git_config_date_string(const char
> > *key, const char **output) static void process_log_file(void) {
> > struct stat st;
> > - if (!fstat(get_lock_file_fd(&log_lock), &st) && st.st_size)
> > + if (fstat(get_lock_file_fd(&log_lock), &st)) {
> > + /*
> > + * Perhaps there was an i/o error or another
> > + * unlikely situation. Try to make a note of
> > + * this in gc.log along with any existing
> > + * messages.
> > + */
> > + FILE *fp;
> > + int saved_errno = errno;
> > + fp = fdopen(log_lock.tempfile.fd, "a");
>
> We usually use xfdopen() to handle (unlikely) errors rather than segfaulting. But
> I think you'd actually want fdopen_lock_file(), which attaches the fd to the
> tempfile for flushing and cleanup purposes.
>
> That said, I'm not sure I understand why you're opening a new stdio filehandle.
> We know that stderr already points to our logfile (that's how content gets there
> in the first place). If there's a problem with the file or the descriptor, opening a
> new filehandle around the same descriptor won't help.
>
> Speaking of stderr, I wonder if this function should be calling
> fflush(stderr) before looking at the fstat result. There could be contents buffered
> there that haven't been written out yet (not from child processes, but perhaps
> ones written in this process itself).
> Probably unlikely in practice, since stderr is typically unbuffered by default.
Process_log_file_at_exit calls fflush. Will fix the other.
^ permalink raw reply
* [ANNOUNCE] Git v2.12.0-rc1
From: Junio C Hamano @ 2017-02-10 21:29 UTC (permalink / raw)
To: git; +Cc: Linux Kernel
A release candidate Git v2.12.0-rc1 is now available for testing
at the usual places. It is comprised of 455 non-merge commits
since v2.11.0, contributed by 65 people, 20 of which are new faces.
The tarballs are found at:
https://www.kernel.org/pub/software/scm/git/testing/
The following public repositories all have a copy of the
'v2.12.0-rc1' tag and the 'master' branch that the tag points at:
url = https://kernel.googlesource.com/pub/scm/git/git
url = git://repo.or.cz/alt-git.git
url = git://git.sourceforge.jp/gitroot/git-core/git.git
url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
url = https://github.com/gitster/git
New contributors whose contributions weren't in v2.11.0 are as follows.
Welcome to the Git development community!
Alan Davies, Andreas Krey, Cornelius Weig, Denton Liu, George
Vanburgh, Igor Kushnir, Jack Bates, Kristoffer Haugsbakk, Kyle
Meyer, Luis Ressel, Lukas Puehringer, Markus Hitter, Peter Law,
Rasmus Villemoes, Rogier Goossens, Stefan Dotterweich, Steven
Penny, Vinicius Kursancew, Vladimir Panteleev, and Wolfram Sang.
Returning contributors who helped this release are as follows.
Thanks for your continued support.
마누엘, Alex Henrie, Beat Bolli, Brandon Williams, brian
m. carlson, Chris Packham, Christian Couder, David Aguilar, David
Turner, Dennis Kaarsemaker, Dimitriy Ryazantcev, Elia Pinto,
Eric Wong, Heiko Voigt, Jacob Keller, Jeff Hostetler, Jeff King,
Johannes Schindelin, Johannes Sixt, Jonathan Tan, Junio C Hamano,
Kyle J. McKay, Lars Schneider, Linus Torvalds, Luke Diamand, Matt
McCutchen, Max Kirillov, Mike Hommey, Nguyễn Thái Ngọc Duy,
Patrick Steinhardt, Paul Mackerras, Philip Oakley, Pranit Bauva,
Ramsay Jones, René Scharfe, Richard Hansen, Santiago Torres,
Satoshi Yasushima, Stefan Beller, Stephan Beyer, SZEDER Gábor,
Torsten Bögershausen, Vasco Almeida, Vegard Nossum, and Vitaly
"_Vi" Shukela.
----------------------------------------------------------------
Git 2.12 Release Notes (draft)
==============================
Backward compatibility notes.
* Use of an empty string that is used for 'everything matches' is
still warned and Git asks users to use a more explicit '.' for that
instead. The hope is that existing users will not mind this
change, and eventually the warning can be turned into a hard error,
upgrading the deprecation into removal of this (mis)feature. That
is not scheduled to happen in the upcoming release (yet).
* The historical argument order "git merge <msg> HEAD <commit>..."
has been deprecated for quite some time, and will be removed in a
future release.
* An ancient script "git relink" has been removed.
Updates since v2.11
-------------------
UI, Workflows & Features
* Various updates to "git p4".
* "git p4" didn't interact with the internal of .git directory
correctly in the modern "git-worktree"-enabled world.
* "git branch --list" and friends learned "--ignore-case" option to
optionally sort branches and tags case insensitively.
* In addition to %(subject), %(body), "log --pretty=format:..."
learned a new placeholder %(trailers).
* "git rebase" learned "--quit" option, which allows a user to
remove the metadata left by an earlier "git rebase" that was
manually aborted without using "git rebase --abort".
* "git clone --reference $there --recurse-submodules $super" has been
taught to guess repositories usable as references for submodules of
$super that are embedded in $there while making a clone of the
superproject borrow objects from $there; extend the mechanism to
also allow submodules of these submodules to borrow repositories
embedded in these clones of the submodules embedded in the clone of
the superproject.
* Porcelain scripts written in Perl are getting internationalized.
* "git merge --continue" has been added as a synonym to "git commit"
to conclude a merge that has stopped due to conflicts.
* Finer-grained control of what protocols are allowed for transports
during clone/fetch/push have been enabled via a new configuration
mechanism.
* "git shortlog" learned "--committer" option to group commits by
committer, instead of author.
* GitLFS integration with "git p4" has been updated.
* The isatty() emulation for Windows has been updated to eradicate
the previous hack that depended on internals of (older) MSVC
runtime.
* Some platforms no longer understand "latin-1" that is still seen in
the wild in e-mail headers; replace them with "iso-8859-1" that is
more widely known when conversion fails from/to it.
* "git grep" has been taught to optionally recurse into submodules.
* "git rm" used to refuse to remove a submodule when it has its own
git repository embedded in its working tree. It learned to move
the repository away to $GIT_DIR/modules/ of the superproject
instead, and allow the submodule to be deleted (as long as there
will be no loss of local modifications, that is).
* A recent updates to "git p4" was not usable for older p4 but it
could be made to work with minimum changes. Do so.
* "git diff" learned diff.interHunkContext configuration variable
that gives the default value for its --inter-hunk-context option.
* The prereleaseSuffix feature of version comparison that is used in
"git tag -l" did not correctly when two or more prereleases for the
same release were present (e.g. when 2.0, 2.0-beta1, and 2.0-beta2
are there and the code needs to compare 2.0-beta1 and 2.0-beta2).
* "git submodule push" learned "--recurse-submodules=only option to
push submodules out without pushing the top-level superproject.
* "git tag" and "git verify-tag" learned to put GPG verification
status in their "--format=<placeholders>" output format.
* An ancient repository conversion tool left in contrib/ has been
removed.
* "git show-ref HEAD" used with "--verify" because the user is not
interested in seeing refs/remotes/origin/HEAD, and used with
"--head" because the user does not want HEAD to be filtered out,
i.e. "git show-ref --head --verify HEAD", did not work as expected.
* "git submodule add" used to be confused and refused to add a
locally created repository; users can now use "--force" option
to add them.
(merge 619acfc78c sb/submodule-add-force later to maint).
* Some people feel the default set of colors used by "git log --graph"
rather limiting. A mechanism to customize the set of colors has
been introduced.
* "git read-tree" and its underlying unpack_trees() machinery learned
to report problematic paths prefixed with the --super-prefix option.
* When a submodule "A", which has another submodule "B" nested within
it, is "absorbed" into the top-level superproject, the inner
submodule "B" used to be left in a strange state. The logic to
adjust the .git pointers in these submodules has been corrected.
* The user can specify a custom update method that is run when
"submodule update" updates an already checked out submodule. This
was ignored when checking the submodule out for the first time and
we instead always just checked out the commit that is bound to the
path in the superproject's index.
* The command line completion (in contrib/) learned that
"git diff --submodule=" can take "diff" as a recently added option.
* The "core.logAllRefUpdates" that used to be boolean has been
enhanced to take 'always' as well, to record ref updates to refs
other than the ones that are expected to be updated (i.e. branches,
remote-tracking branches and notes).
Performance, Internal Implementation, Development Support etc.
* Commands that operate on a log message and add lines to the trailer
blocks, such as "format-patch -s", "cherry-pick (-x|-s)", and
"commit -s", have been taught to use the logic of and share the
code with "git interpret-trailer".
* The default Travis-CI configuration specifies newer P4 and GitLFS.
* The "fast hash" that had disastrous performance issues in some
corner cases has been retired from the internal diff.
* The character width table has been updated to match Unicode 9.0
* Update the procedure to generate "tags" for developer support.
* The codeflow of setting NOATIME and CLOEXEC on file descriptors Git
opens has been simplified.
* "git diff" and its family had two experimental heuristics to shift
the contents of a hunk to make the patch easier to read. One of
them turns out to be better than the other, so leave only the
"--indent-heuristic" option and remove the other one.
* A new submodule helper "git submodule embedgitdirs" to make it
easier to move embedded .git/ directory for submodules in a
superproject to .git/modules/ (and point the latter with the former
that is turned into a "gitdir:" file) has been added.
* "git push \\server\share\dir" has recently regressed and then
fixed. A test has retroactively been added for this breakage.
* Build updates for Cygwin.
* The implementation of "real_path()" was to go there with chdir(2)
and call getcwd(3), but this obviously wouldn't be usable in a
threaded environment. Rewrite it to manually resolve relative
paths including symbolic links in path components.
* Adjust documentation to help AsciiDoctor render better while not
breaking the rendering done by AsciiDoc.
* The sequencer machinery has been further enhanced so that a later
set of patches can start using it to reimplement "rebase -i".
* Update the definition of the MacOSX test environment used by
TravisCI.
* Rewrite a scripted porcelain "git difftool" in C.
* "make -C t failed" will now run only the tests that failed in the
previous run. This is usable only when prove is not use, and gives
a useless error message when run after "make clean", but otherwise
is serviceable.
* "uchar [40]" to "struct object_id" conversion continues.
Also contains various documentation updates and code clean-ups.
Fixes since v2.10
-----------------
Unless otherwise noted, all the fixes since v2.9 in the maintenance
track are contained in this release (see the maintenance releases'
notes for details).
* We often decide if a session is interactive by checking if the
standard I/O streams are connected to a TTY, but isatty() that
comes with Windows incorrectly returned true if it is used on NUL
(i.e. an equivalent to /dev/null). This has been fixed.
* "git svn" did not work well with path components that are "0", and
some configuration variable it uses were not documented.
* "git rev-parse --symbolic" failed with a more recent notation like
"HEAD^-1" and "HEAD^!".
* An empty directory in a working tree that can simply be nuked used
to interfere while merging or cherry-picking a change to create a
submodule directory there, which has been fixed..
* The code in "git push" to compute if any commit being pushed in the
superproject binds a commit in a submodule that hasn't been pushed
out was overly inefficient, making it unusable even for a small
project that does not have any submodule but have a reasonable
number of refs.
* "git push --dry-run --recurse-submodule=on-demand" wasn't
"--dry-run" in the submodules.
* The output from "git worktree list" was made in readdir() order,
and was unstable.
* mergetool.<tool>.trustExitCode configuration variable did not apply
to built-in tools, but now it does.
* "git p4" LFS support was broken when LFS stores an empty blob.
* A corner case in merge-recursive regression that crept in
during 2.10 development cycle has been fixed.
* Transport with dumb http can be fooled into following foreign URLs
that the end user does not intend to, especially with the server
side redirects and http-alternates mechanism, which can lead to
security issues. Tighten the redirection and make it more obvious
to the end user when it happens.
* Update the error messages from the dumb-http client when it fails
to obtain loose objects; we used to give sensible error message
only upon 404 but we now forbid unexpected redirects that needs to
be reported with something sensible.
* When diff.renames configuration is on (and with Git 2.9 and later,
it is enabled by default, which made it worse), "git stash"
misbehaved if a file is removed and another file with a very
similar content is added.
* "git diff --no-index" did not take "--no-abbrev" option.
* "git difftool --dir-diff" had a minor regression when started from
a subdirectory, which has been fixed.
* "git commit --allow-empty --only" (no pathspec) with dirty index
ought to be an acceptable way to create a new commit that does not
change any paths, but it was forbidden, perhaps because nobody
needed it so far.
* Git 2.11 had a minor regression in "merge --ff-only" that competed
with another process that simultanously attempted to update the
index. We used to explain what went wrong with an error message,
but the new code silently failed. The error message has been
resurrected.
* A pathname that begins with "//" or "\\" on Windows is special but
path normalization logic was unaware of it.
* "git pull --rebase", when there is no new commits on our side since
we forked from the upstream, should be able to fast-forward without
invoking "git rebase", but it didn't.
* The way to specify hotkeys to "xxdiff" that is used by "git
mergetool" has been modernized to match recent versions of xxdiff.
* Unlike "git am --abort", "git cherry-pick --abort" moved HEAD back
to where cherry-pick started while picking multiple changes, when
the cherry-pick stopped to ask for help from the user, and the user
did "git reset --hard" to a different commit in order to re-attempt
the operation.
* Code cleanup in shallow boundary computation.
* A recent update to receive-pack to make it easier to drop garbage
objects made it clear that GIT_ALTERNATE_OBJECT_DIRECTORIES cannot
have a pathname with a colon in it (no surprise!), and this in turn
made it impossible to push into a repository at such a path. This
has been fixed by introducing a quoting mechanism used when
appending such a path to the colon-separated list.
* The function usage_msg_opt() has been updated to say "fatal:"
before the custom message programs give, when they want to die
with a message about wrong command line options followed by the
standard usage string.
* "git index-pack --stdin" needs an access to an existing repository,
but "git index-pack file.pack" to generate an .idx file that
corresponds to a packfile does not.
* Fix for NDEBUG builds.
* A lazy "git push" without refspec did not internally use a fully
specified refspec to perform 'current', 'simple', or 'upstream'
push, causing unnecessary "ambiguous ref" errors.
* "git p4" misbehaved when swapping a directory and a symbolic link.
* Even though an fix was attempted in Git 2.9.3 days, but running
"git difftool --dir-diff" from a subdirectory never worked. This
has been fixed.
* "git p4" that tracks multile p4 paths imported a single changelist
that touches files in these multiple paths as one commit, followed
by many empty commits. This has been fixed.
* A potential but unlikely buffer overflow in Windows port has been
fixed.
* When the http server gives an incomplete response to a smart-http
rpc call, it could lead to client waiting for a full response that
will never come. Teach the client side to notice this condition
and abort the transfer.
* Compression setting for producing packfiles were spread across
three codepaths, one of which did not honor any configuration.
Unify these so that all of them honor core.compression and
pack.compression variables the same way.
* "git fast-import" sometimes mishandled while rebalancing notes
tree, which has been fixed.
* Recent update to the default abbreviation length that auto-scales
lacked documentation update, which has been corrected.
* Leakage of lockfiles in the config subsystem has been fixed.
* It is natural that "git gc --auto" may not attempt to pack
everything into a single pack, and there is no point in warning
when the user has configured the system to use the pack bitmap,
leading to disabling further "gc".
* "git archive" did not read the standard configuration files, and
failed to notice a file that is marked as binary via the userdiff
driver configuration.
* "git blame --porcelain" misidentified the "previous" <commit, path>
pair (aka "source") when contents came from two or more files.
* "git rebase -i" with a recent update started showing an incorrect
count when squashing more than 10 commits.
* "git <cmd> @{push}" on a detached HEAD used to segfault; it has
been corrected to error out with a message.
* Running "git add a/b" when "a" is a submodule correctly errored
out, but without a meaningful error message.
(merge 2d81c48fa7 sb/pathspec-errors later to maint).
* Typing ^C to pager, which usually does not kill it, killed Git and
took the pager down as a collateral damage in certain process-tree
structure. This has been fixed.
* "git mergetool" without any pathspec on the command line that is
run from a subdirectory became no-op in Git v2.11 by mistake, which
has been fixed.
* Retire long unused/unmaintained gitview from the contrib/ area.
(merge 3120925c25 sb/remove-gitview later to maint).
* Tighten a test to avoid mistaking an extended ERE regexp engine as
a PRE regexp engine.
* An error message with an ASCII control character like '\r' in it
can alter the message to hide its early part, which is problematic
when a remote side gives such an error message that the local side
will relay with a "remote: " prefix.
(merge f290089879 jk/vreport-sanitize later to maint).
* "git fsck" inspects loose objects more carefully now.
(merge cce044df7f jk/loose-object-fsck later to maint).
* A crashing bug introduced in v2.11 timeframe has been found (it is
triggerable only in fast-import) and fixed.
(merge abd5a00268 jk/clear-delta-base-cache-fix later to maint).
* With an anticipatory tweak for remotes defined in ~/.gitconfig
(e.g. "remote.origin.prune" set to true, even though there may or
may not actually be "origin" remote defined in a particular Git
repository), "git remote rename" and other commands misinterpreted
and behaved as if such a non-existing remote actually existed.
(merge e459b073fb js/remote-rename-with-half-configured-remote later to maint).
* A few codepaths had to rely on a global variable when sorting
elements of an array because sort(3) API does not allow extra data
to be passed to the comparison function. Use qsort_s() when
natively available, and a fallback implementation of it when not,
to eliminate the need, which is a prerequisite for making the
codepath reentrant.
* "git fsck --connectivity-check" was not working at all.
(merge a2b22854bd jk/fsck-connectivity-check-fix later to maint).
* After starting "git rebase -i", which first opens the user's editor
to edit the series of patches to apply, but before saving the
contents of that file, "git status" failed to show the current
state (i.e. you are in an interactive rebase session, but you have
applied no steps yet) correctly.
(merge df9ded4984 js/status-pre-rebase-i later to maint).
* Test tweak for FreeBSD where /usr/bin/unzip is unsuitable to run
our tests but /usr/local/bin/unzip is usable.
(merge d98b2c5fce js/unzip-in-usr-bin-workaround later to maint).
* "git p4" did not work well with multiple git-p4.mapUser entries on
Windows.
(merge c3c2b05776 gv/mingw-p4-mapuser later to maint).
* "git help" enumerates executable files in $PATH; the implementation
of "is this file executable?" on Windows has been optimized.
(merge c755015f79 hv/mingw-help-is-executable later to maint).
* Test tweaks for those who have default ACL in their git source tree
that interfere with the umask test.
(merge d549d21307 mm/reset-facl-before-umask-test later to maint).
* Names of the various hook scripts must be spelled exactly, but on
Windows, an .exe binary must be named with .exe suffix; notice
$GIT_DIR/hooks/<hookname>.exe as a valid <hookname> hook.
(merge 235be51fbe js/mingw-hooks-with-exe-suffix later to maint).
* Asciidoctor, an alternative reimplementation of AsciiDoc, still
needs some changes to work with documents meant to be formatted
with AsciiDoc. "make USE_ASCIIDOCTOR=YesPlease" to use it out of
the box to document our pages is getting closer to reality.
* Correct command line completion (in contrib/) on "git svn"
(merge 2cbad17642 ew/complete-svn-authorship-options later to maint).
* Incorrect usage help message for "git worktree prune" has been fixed.
(merge 2488dcab22 ps/worktree-prune-help-fix later to maint).
* Adjust a perf test to new world order where commands that do
require a repository are really strict about having a repository.
(merge c86000c1a7 rs/p5302-create-repositories-before-tests later to maint).
* "git log --graph" did not work well with "--name-only", even though
other forms of "diff" output were handled correctly.
(merge f5022b5fed jk/log-graph-name-only later to maint).
* Other minor doc, test and build updates and code cleanups.
(merge f2627d9b19 sb/submodule-config-cleanup later to maint).
(merge 384f1a167b sb/unpack-trees-cleanup later to maint).
(merge 874444b704 rh/diff-orderfile-doc later to maint).
(merge eafd5d9483 cw/doc-sign-off later to maint).
(merge 0aaad415bc rs/absolute-pathdup later to maint).
(merge 4432dd6b5b rs/receive-pack-cleanup later to maint).
(merge 540a398e9c sg/mailmap-self later to maint).
(merge 209df269a6 nd/rev-list-all-includes-HEAD-doc later to maint).
----------------------------------------------------------------
Changes since v2.11.0 are as follows:
Alan Davies (1):
mingw: fix colourization on Cygwin pseudo terminals
Alex Henrie (3):
bisect: improve English grammar of not-ancestors message
receive-pack: improve English grammar of denyCurrentBranch message
clone,fetch: explain the shallow-clone option a little more clearly
Andreas Krey (2):
commit: make --only --allow-empty work without paths
commit: remove 'Clever' message for --only --amend
Beat Bolli (6):
update_unicode.sh: move it into contrib/update-unicode
update_unicode.sh: remove an unnecessary subshell level
update_unicode.sh: pin the uniset repo to a known good commit
update_unicode.sh: automatically download newer definition files
update_unicode.sh: remove the plane filter
unicode_width.h: update the width tables to Unicode 9.0
Brandon Williams (40):
push: --dry-run updates submodules when --recurse-submodules=on-demand
push: fix --dry-run to not push submodules
real_path: resolve symlinks by hand
real_path: convert real_path_internal to strbuf_realpath
real_path: create real_pathdup
real_path: have callers use real_pathdup and strbuf_realpath
lib-proto-disable: variable name fix
http: always warn if libcurl version is too old
transport: add protocol policy config option
http: create function to get curl allowed protocols
transport: add from_user parameter to is_transport_allowed
transport: reformat flag #defines to be more readable
submodules: add RECURSE_SUBMODULES_ONLY value
push: add option to push only submodules
submodules: add helper to determine if a submodule is populated
submodules: add helper to determine if a submodule is initialized
submodules: load gitmodules file from commit sha1
grep: add submodules as a grep source type
grep: optionally recurse into submodules
grep: enable recurse-submodules to work on <tree> objects
grep: search history of moved submodules
mv: remove use of deprecated 'get_pathspec()'
dir: remove struct path_simplify
dir: convert fill_directory to use the pathspec struct interface
ls-tree: convert show_recursive to use the pathspec struct interface
pathspec: remove the deprecated get_pathspec function
pathspec: copy and free owned memory
pathspec: remove unused variable from unsupported_magic
pathspec: always show mnemonic and name in unsupported_magic
pathspec: simpler logic to prefix original pathspec elements
pathspec: factor global magic into its own function
pathspec: create parse_short_magic function
pathspec: create parse_long_magic function
pathspec: create parse_element_magic helper
pathspec: create strip submodule slash helpers
pathspec: small readability changes
pathspec: rename prefix_pathspec to init_pathspec_item
real_path: prevent redefinition of MAXSYMLINKS
real_path: set errno when max number of symlinks is exceeded
index: improve constness for reading blob data
Chris Packham (3):
merge: add '--continue' option as a synonym for 'git commit'
completion: add --continue option for merge
merge: ensure '--abort' option takes no arguments
Christian Couder (1):
Documentation/bisect: improve on (bad|new) and (good|bad)
Cornelius Weig (7):
doc: clarify distinction between sign-off and pgp-signing
config: add markup to core.logAllRefUpdates doc
refs: add option core.logAllRefUpdates = always
update-ref: add test cases for bare repository
doc: add doc for git-push --recurse-submodules=only
completion: add completion for --recurse-submodules=only
doc: add note about ignoring '--no-create-reflog'
David Aguilar (12):
mergetool: honor mergetool.$tool.trustExitCode for built-in tools
mergetools/vimdiff: trust Vim's exit code
difftool: fix dir-diff index creation when in a subdirectory
difftool: fix dir-diff index creation when in a subdirectory
difftool: sanitize $workdir as early as possible
difftool: chdir as early as possible
difftool: rename variables for consistency
mergetools: fix xxdiff hotkeys
gitk: Remove translated message from comments
difftool: fix bug when printing usage
t7800: simplify basic usage test
t7800: replace "wc -l" with test_line_count
David Turner (5):
submodules: allow empty working-tree dirs in merge/cherry-pick
remote-curl: don't hang when a server dies before any output
upload-pack: optionally allow fetching any sha1
auto gc: don't write bitmaps for incremental repacks
repack: die on incremental + write-bitmap-index
Dennis Kaarsemaker (1):
push: test pushing ambiguously named branches
Denton Liu (1):
Document the --no-gui option in difftool
Dimitriy Ryazantcev (1):
gitk: ru.po: Update Russian translation
Elia Pinto (2):
builtin/commit.c: remove the PATH_MAX limitation via dynamic allocation
builtin/commit.c: switch to strbuf, instead of snprintf()
Eric Wong (3):
git-svn: allow "0" in SVN path components
git-svn: document useLogAuthor and addAuthorFrom config keys
completion: fix git svn authorship switches
George Vanburgh (2):
git-p4: fix multi-path changelist empty commits
git-p4: fix git-p4.mapUser on Windows
Heiko Voigt (5):
serialize collection of changed submodules
serialize collection of refs that contain submodule changes
batch check whether submodule needs pushing into one call
submodule_needs_pushing(): explain the behaviour when we cannot answer
help: improve is_executable() on Windows
Igor Kushnir (1):
git-p4: do not pass '-r 0' to p4 commands
Jack Bates (1):
diff: handle --no-abbrev in no-index case
Jacob Keller (3):
pretty: add %(trailers) format for displaying trailers of a commit message
ref-filter: add support to display trailers as part of contents
reset: add an example of how to split a commit into two
Jeff Hostetler (1):
mingw: replace isatty() hack
Jeff King (58):
rev-parse: fix parent shorthands with --symbolic
t7610: clean up foo.XXXXXX tmpdir
http: simplify update_url_from_redirect
http: always update the base URL for redirects
remote-curl: rename shadowed options variable
http: make redirects more obvious
http: treat http-alternates like redirects
http-walker: complain about non-404 loose object errors
xdiff: drop XDL_FAST_HASH
stash: prefer plumbing over git-diff
alternates: accept double-quoted paths
tmp-objdir: quote paths we add to alternates
Makefile: reformat FIND_SOURCE_FILES
Makefile: exclude test cruft from FIND_SOURCE_FILES
Makefile: match shell scripts in FIND_SOURCE_FILES
Makefile: exclude contrib from FIND_SOURCE_FILES
parse-options: print "fatal:" before usage_msg_opt()
http: respect protocol.*.allow=user for http-alternates
README: replace gmane link with public-inbox
merge: mark usage error strings for translation
t5000: extract nongit function to test-lib-functions.sh
index-pack: complain when --stdin is used outside of a repo
t: use nongit() function where applicable
shortlog: test and document --committer option
index-pack: skip collision check when not in repository
archive-zip: load userdiff config
rebase--interactive: count squash commits above 10 correctly
blame: fix alignment with --abbrev=40
blame: handle --no-abbrev
blame: output porcelain "previous" header for each file
git_exec_path: do not return the result of getenv()
execv_dashed_external: use child_process struct
execv_dashed_external: stop exiting with negative code
execv_dashed_external: wait for child on signal death
t7810: avoid assumption about invalid regex syntax
Revert "vreportf: avoid intermediate buffer"
vreport: sanitize ASCII control chars
t1450: refactor loose-object removal
sha1_file: fix error message for alternate objects
t1450: test fsck of packed objects
sha1_file: add read_loose_object() function
fsck: parse loose object paths directly
fsck: detect trailing garbage in all object types
t1450: clean up sub-objects in duplicate-entry test
fsck: report trees as dangling
fsck: prepare dummy objects for --connectivity-check
fsck: tighten error-checks of "git fsck <head>"
fsck: do not fallback "git fsck <bogus>" to "git fsck"
fsck: check HAS_OBJ more consistently
CodingGuidelines: clarify multi-line brace style
clear_delta_base_cache(): don't modify hashmap while iterating
t1450: use "mv -f" within loose object directory
difftool: hack around -Wzero-length-format warning
fsck: move typename() printing to its own function
fsck: lazily load types under --connectivity-only
color_parse_mem: allow empty color spec
document behavior of empty color name
diff: print line prefix for --name-only output
Johannes Schindelin (56):
cherry-pick: demonstrate a segmentation fault
merge-recursive: handle NULL in add_cacheinfo() correctly
mingw: intercept isatty() to handle /dev/null as Git expects it
mingw: adjust is_console() to work with stdin
mingw: add a regression test for pushing to UNC paths
giteveryday: unbreak rendering with AsciiDoctor
git_exec_path: avoid Coverity warning about unfree()d result
sequencer: avoid unnecessary curly braces
sequencer: move "else" keyword onto the same line as preceding brace
sequencer: use a helper to find the commit message
sequencer: support a new action: 'interactive rebase'
sequencer (rebase -i): implement the 'noop' command
sequencer (rebase -i): implement the 'edit' command
sequencer (rebase -i): implement the 'exec' command
sequencer (rebase -i): learn about the 'verbose' mode
sequencer (rebase -i): write the 'done' file
sequencer (rebase -i): add support for the 'fixup' and 'squash' commands
sequencer (rebase -i): implement the short commands
sequencer (rebase -i): write an author-script file
sequencer (rebase -i): allow continuing with staged changes
sequencer (rebase -i): remove CHERRY_PICK_HEAD when no longer needed
sequencer (rebase -i): skip some revert/cherry-pick specific code path
sequencer (rebase -i): the todo can be empty when continuing
sequencer (rebase -i): update refs after a successful rebase
sequencer (rebase -i): leave a patch upon error
sequencer (rebase -i): implement the 'reword' command
sequencer (rebase -i): allow fast-forwarding for edit/reword
sequencer (rebase -i): refactor setting the reflog message
sequencer (rebase -i): set the reflog message consistently
sequencer (rebase -i): copy commit notes at end
sequencer (rebase -i): record interrupted commits in rewritten, too
sequencer (rebase -i): run the post-rewrite hook, if needed
sequencer (rebase -i): respect the rebase.autostash setting
sequencer (rebase -i): respect strategy/strategy_opts settings
sequencer (rebase -i): allow rescheduling commands
sequencer (rebase -i): implement the 'drop' command
sequencer (rebase -i): differentiate between comments and 'noop'
difftool: add a skeleton for the upcoming builtin
sequencer: update reading author-script
sequencer: use run_command() directly
sequencer (rebase -i): show only failed `git commit`'s output
sequencer (rebase -i): show only failed cherry-picks' output
sequencer (rebase -i): suggest --edit-todo upon unknown command
sequencer (rebase -i): show the progress
sequencer (rebase -i): write the progress into files
sequencer (rebase -i): write out the final message
mingw: follow-up to "replace isatty() hack"
difftool: implement the functionality in the builtin
difftool: retire the scripted version
remote rename: demonstrate a bogus "remote exists" bug
remote rename: more carefully determine whether a remote is configured
relink: retire the command
status: be prepared for not-yet-started interactive rebase
t/Makefile: add a rule to re-run previously-failed tests
test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/
mingw: allow hooks to be .exe files
Johannes Sixt (4):
t5547-push-quarantine: run the path separator test on Windows, too
normalize_path_copy(): fix pushing to //server/share/dir on Windows
t5615-alternate-env: double-quotes in file names do not work on Windows
real_path: canonicalize directory separators in root parts
Jonathan Tan (6):
fetch: do not redundantly calculate tag refmap
trailer: be stricter in parsing separators
commit: make ignore_non_trailer take buf/len
trailer: avoid unnecessary splitting on lines
trailer: have function to describe trailer layout
sequencer: use trailer's trailer layout
Junio C Hamano (37):
utf8: refactor code to decide fallback encoding
utf8: accept "latin-1" as ISO-8859-1
git_open(): untangle possible NOATIME and CLOEXEC interactions
push: do not use potentially ambiguous default refspec
git_open_cloexec(): use fcntl(2) w/ FD_CLOEXEC fallback
sha1_file: stop opening files with O_NOATIME
compression: unify pack.compression configuration parsing
pull: fast-forward "pull --rebase=true"
preparing for 2.10.3
Start post 2.11 cycle
wt-status: implement opportunisitc index update correctly
hold_locked_index(): align error handling with hold_lockfile_for_update()
lockfile: LOCK_REPORT_ON_ERROR
Early fixes for 2.11.x series
Revert "sequencer: remove useless get_dir() function"
First batch for 2.12
Second batch for 2.12
i18n: fix misconversion in shell scripts
t4201: make tests work with and without the MINGW prerequiste
Third batch for 2.12
config.abbrev: document the new default that auto-scales
diff: retire "compaction" heuristics
lockfile: move REPORT_ON_ERROR bit elsewhere
Fourth batch for 2.12
Fifth batch 2.12
Almost ready for 2.11.1
RelNotes: drop merge-later comments for maint
Sixth batch for 2.12
Seventh batch for 2.12
show-ref: remove a stale comment
relink: really remove the command
Eighth batch for 2.12
Ready for 2.11.1
Git 2.11.1
Ninth batch for 2.12; almost ready for -rc0
Git 2.12-rc0
Git 2.12-rc1
Kristoffer Haugsbakk (4):
doc: add articles (grammar)
doc: add verb in front of command to run
doc: make the intent of sentence clearer
doc: omit needless "for"
Kyle J. McKay (1):
mailinfo.c: move side-effects outside of assert
Kyle Meyer (1):
branch_get_push: do not segfault when HEAD is detached
Lars Schneider (8):
git-p4: add config to retry p4 commands; retry 3 times by default
travis-ci: update P4 to 16.2 and GitLFS to 1.5.2 in Linux build
git-p4: fix empty file processing for large file system backend GitLFS
t0021: minor filter process test cleanup
docs: warn about possible '=' in clean/smudge filter process values
t0021: fix flaky test
git-p4: add diff/merge properties to .gitattributes for GitLFS files
travis-ci: fix Perforce install on macOS
Linus Torvalds (1):
shortlog: group by committer information
Luis Ressel (1):
date-formats.txt: Typo fix
Lukas Puehringer (3):
gpg-interface, tag: add GPG_VERIFY_OMIT_STATUS flag
ref-filter: add function to print single ref_array_item
builtin/tag: add --format argument for tag -v
Luke Diamand (3):
git-p4: support updating an existing shelved changelist
git-p4: support git worktrees
git-p4: avoid crash adding symlinked directory
Markus Hitter (3):
gitk: Turn off undo manager in the text widget
gitk: Remove closed file descriptors from $blobdifffd
gitk: Clear array 'commitinfo' on reload
Matt McCutchen (3):
doc: mention transfer data leaks in more places
git-gc.txt: expand discussion of races with other processes
t0001: don't let a default ACL interfere with the umask test
Max Kirillov (1):
mingw: consider that UNICODE_STRING::Length counts bytes
Mike Hommey (1):
fast-import: properly fanout notes when tree is imported
Nguyễn Thái Ngọc Duy (19):
worktree.c: zero new 'struct worktree' on allocation
worktree: reorder an if statement
get_worktrees() must return main worktree as first item even on error
worktree.c: get_worktrees() takes a new flag argument
worktree list: keep the list sorted
merge-recursive.c: use string_list_sort instead of qsort
tag, branch, for-each-ref: add --ignore-case for sorting and filtering
shallow.c: rename fields in paint_info to better express their purposes
shallow.c: stop abusing COMMIT_SLAB_SIZE for paint_info's memory pools
shallow.c: make paint_alloc slightly more robust
shallow.c: remove useless code
rebase: add --quit to cleanup rebase, leave everything else untouched
config.c: handle error case for fstat() calls
config.c: rename label unlock_and_out
config.c: handle lock file in error case in git_config_rename_...
color.c: fix color_parse_mem() with value_len == 0
color.c: trim leading spaces in color_parse_mem()
log --graph: customize the graph lines with config log.graphColors
rev-list-options.txt: update --all about HEAD
Patrick Steinhardt (1):
worktree: fix option descriptions for `prune`
Paul Mackerras (2):
gitk: Use explicit RGB green instead of "lime"
gitk: Update copyright notice to 2016
Peter Law (1):
Completion: Add support for --submodule=diff
Philip Oakley (3):
doc: gitk: remove gitview reference
doc: gitk: add the upstream repo location
doc: git-gui browser does not default to HEAD
Pranit Bauva (2):
don't use test_must_fail with grep
t9813: avoid using pipes
Ramsay Jones (1):
GIT-VERSION-GEN: do not force abbreviation length used by 'describe'
Rasmus Villemoes (2):
shallow.c: avoid theoretical pointer wrap-around
shallow.c: bit manipulation tweaks
René Scharfe (13):
compat: add qsort_s()
add QSORT_S
perf: add basic sort performance test
string-list: use QSORT_S in string_list_sort()
ref-filter: use QSORT_S in ref_array_sort()
abspath: add absolute_pathdup()
use absolute_pathdup()
use oid_to_hex_r() for converting struct object_id hashes to hex strings
use oidcpy() for copying hashes between instances of struct object_id
checkout: convert post_checkout_hook() to struct object_id
receive-pack: call string_list_clear() unconditionally
p5302: create repositories for index-pack results explicitly
dir: avoid allocation in fill_directory()
Richard Hansen (16):
.mailmap: record canonical email for Richard Hansen
rev-parse doc: pass "--" to rev-parse in the --prefix example
t7610: update branch names to match test number
t7610: move setup code to the 'setup' test case
t7610: use test_when_finished for cleanup tasks
t7610: don't rely on state from previous test
t7610: run 'git reset --hard' after each test to clean up
t7610: delete some now-unnecessary 'git reset --hard' lines
t7610: always work on a test-specific branch
t7610: don't assume the checked-out commit
t7610: spell 'git reset --hard' consistently
t7610: add test case for rerere+mergetool+subdir bug
mergetool: take the "-O" out of $orderfile
mergetool: fix running in subdir when rerere enabled
diff: document behavior of relative diff.orderFile
diff: document the format of the -O (diff.orderFile) file
Rogier Goossens (3):
gitk: Add a 'rename' option to the branch context menu
gitk: Allow checking out a remote branch
gitk: Include commit title in branch dialog
SZEDER Gábor (9):
t7004-tag: delete unnecessary tags with test_when_finished
t7004-tag: use test_config helper
t7004-tag: add version sort tests to show prerelease reordering issues
versioncmp: pass full tagnames to swap_prereleases()
versioncmp: cope with common part overlapping with prerelease suffix
versioncmp: use earliest-longest contained suffix to determine sorting order
versioncmp: factor out helper for suffix matching
versioncmp: generalize version sort suffix reordering
.mailmap: update Gábor Szeder's email address
Santiago Torres (3):
builtin/verify-tag: add --format to verify-tag
t/t7030-verify-tag: Add --format specifier tests
t/t7004-tag: Add --format specifier tests
Satoshi Yasushima (1):
gitk: Fix Japanese translation for "marked commit"
Stefan Beller (42):
submodule config: inline config_from_{name, path}
submodule-config: rename commit_sha1 to treeish_name
submodule-config: clarify parsing of null_sha1 element
submodule add: extend force flag to add existing repos
unpack-trees: fix grammar for untracked files in directories
t3600: remove useless redirect
submodule: use absolute path for computing relative path connecting
submodule helper: support super prefix
test-lib-functions.sh: teach test_commit -C <dir>
worktree: check if a submodule uses worktrees
move connect_work_tree_and_git_dir to dir.h
submodule: add absorb-git-dir function
t3600: slightly modernize style
worktree: initialize return value for submodule_uses_worktrees
submodule.h: add extern keyword to functions
submodule: modernize ok_to_remove_submodule to use argv_array
submodule: rename and add flags to ok_to_remove_submodule
rm: absorb a submodules git dir before deletion
submodule.c: use GIT_DIR_ENVIRONMENT consistently
contrib: remove gitview
pathspec: give better message for submodule related pathspec error
unpack-trees: move checkout state into check_updates
unpack-trees: remove unneeded continue
unpack-trees: factor progress setup out of check_updates
read-tree: use OPT_BOOL instead of OPT_SET_INT
t1000: modernize style
t1001: modernize style
submodule absorbgitdirs: mention in docstring help
t7411: quote URLs
t7411: test lookup of uninitialized submodules
submodule update --init: display correct path from submodule
lib-submodule-update.sh: reduce use of subshell by using "git -C"
cache.h: document index_name_pos
cache.h: document remove_index_entry_at
cache.h: document add_[file_]to_index
documentation: retire unfinished documentation
contrib: remove git-convert-objects
unpack-trees: support super-prefix option
setup: add gentle version of resolve_git_dir
cache.h: expose the dying procedure for reading gitlinks
submodule absorbing: fix worktree/gitdir pointers recursively for non-moves
submodule update: run custom update script for initial populating as well
Stefan Dotterweich (1):
gitk: Fix missing commits when using -S or -G
Stephan Beyer (5):
am: fix filename in safe_to_abort() error message
am: change safe_to_abort()'s not rewinding error into a warning
t3510: test that cherry-pick --abort does not unsafely change HEAD
sequencer: make sequencer abort safer
sequencer: remove useless get_dir() function
Steven Penny (2):
Makefile: POSIX windres
Makefile: put LIBS after LDFLAGS for imap-send
Torsten Bögershausen (1):
convert: git cherry-pick -Xrenormalize did not work
Vasco Almeida (18):
gitk: Makefile: create install bin directory
gitk: Add Portuguese translation
Git.pm: add subroutines for commenting lines
i18n: add--interactive: mark strings for translation
i18n: add--interactive: mark simple here-documents for translation
i18n: add--interactive: mark strings with interpolation for translation
i18n: clean.c: match string with git-add--interactive.perl
i18n: add--interactive: mark plural strings
i18n: add--interactive: mark patch prompt for translation
i18n: add--interactive: i18n of help_patch_cmd
i18n: add--interactive: mark edit_hunk_manually message for translation
i18n: add--interactive: remove %patch_modes entries
i18n: add--interactive: mark status words for translation
i18n: send-email: mark strings for translation
i18n: send-email: mark warnings and errors for translation
i18n: send-email: mark string with interpolation for translation
i18n: send-email: mark composing message for translation
i18n: difftool: mark warnings for translation
Vegard Nossum (1):
diff: add interhunk context config option
Vinicius Kursancew (1):
git-p4: allow submit to create shelved changelists.
Vitaly "_Vi" Shukela (1):
submodule--helper: set alternateLocation for cloned submodules
Vladimir Panteleev (5):
show-ref: accept HEAD with --verify
show-ref: allow -d to work with --verify
show-ref: move --quiet handling into show_one()
show-ref: detect dangling refs under --verify as well
show-ref: remove dead `if (verify)' check
Wolfram Sang (1):
request-pull: drop old USAGE stuff
brian m. carlson (8):
Documentation: fix warning in cat-texi.perl
Documentation: modernize cat-texi.perl
Documentation: remove unneeded argument in cat-texi.perl
Documentation: sort sources for gitman.texi
Documentation: add XSLT to fix DocBook for Texinfo
Documentation: move dblatex arguments into variable
Makefile: add a knob to enable the use of Asciidoctor
Documentation: implement linkgit macro for Asciidoctor
마누엘 (1):
asciidoctor: fix user-manual to be built by `asciidoctor`
^ permalink raw reply
* [PATCH v6] gc: ignore old gc.log files
From: David Turner @ 2017-02-10 21:28 UTC (permalink / raw)
To: git; +Cc: peff, pclouds, David Turner, Junio C Hamano
A server can end up in a state where there are lots of unreferenced
loose objects (say, because many users are doing a bunch of rebasing
and pushing their rebased branches). Running "git gc --auto" in
this state would cause a gc.log file to be created, preventing
future auto gcs, causing pack files to pile up. Since many git
operations are O(n) in the number of pack files, this would lead to
poor performance.
Git should never get itself into a state where it refuses to do any
maintenance, just because at some point some piece of the maintenance
didn't make progress.
Teach Git to ignore gc.log files which are older than (by default)
one day old, which can be tweaked via the gc.logExpiry configuration
variable. That way, these pack files will get cleaned up, if
necessary, at least once per day. And operators who find a need for
more-frequent gcs can adjust gc.logExpiry to meet their needs.
There is also some cleanup: a successful manual gc, or a
warning-free auto gc with an old log file, will remove any old
gc.log files.
It might still happen that manual intervention is required
(e.g. because the repo is corrupt), but at the very least it won't
be because Git is too dumb to try again.
Signed-off-by: David Turner <dturner@twosigma.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/config.txt | 6 +++++
builtin/gc.c | 57 ++++++++++++++++++++++++++++++++++++++++++------
t/t6500-gc.sh | 15 +++++++++++++
3 files changed, 71 insertions(+), 7 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index fc5a28a32..a684b7e3e 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1402,6 +1402,12 @@ gc.autoDetach::
Make `git gc --auto` return immediately and run in background
if the system supports it. Default is true.
+gc.logExpiry::
+ If the file gc.log exists, then `git gc --auto` won't run
+ unless that file is more than 'gc.logExpiry' old. Default is
+ "1.day". See `gc.pruneExpire` for more ways to specify its
+ value.
+
gc.packRefs::
Running `git pack-refs` in a repository renders it
unclonable by Git versions prior to 1.5.1.2 over dumb
diff --git a/builtin/gc.c b/builtin/gc.c
index 331f21926..a2b9e8924 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -33,6 +33,8 @@ static int aggressive_window = 250;
static int gc_auto_threshold = 6700;
static int gc_auto_pack_limit = 50;
static int detach_auto = 1;
+static unsigned long gc_log_expire_time;
+static const char *gc_log_expire = "1.day.ago";
static const char *prune_expire = "2.weeks.ago";
static const char *prune_worktrees_expire = "3.months.ago";
@@ -76,10 +78,28 @@ static void git_config_date_string(const char *key, const char **output)
static void process_log_file(void)
{
struct stat st;
- if (!fstat(get_lock_file_fd(&log_lock), &st) && st.st_size)
+ if (fstat(get_lock_file_fd(&log_lock), &st)) {
+ /*
+ * Perhaps there was an i/o error or another
+ * unlikely situation. Try to make a note of
+ * this in gc.log along with any existing
+ * messages.
+ */
+ int saved_errno = errno;
+ fprintf(stderr, _("Failed to fstat %s: %s"),
+ get_tempfile_path(&log_lock.tempfile),
+ strerror(saved_errno));
+ fflush(stderr);
commit_lock_file(&log_lock);
- else
+ errno = saved_errno;
+ } else if (st.st_size) {
+ /* There was some error recorded in the lock file */
+ commit_lock_file(&log_lock);
+ } else {
+ /* No error, clean up any old gc.log */
+ unlink(git_path("gc.log"));
rollback_lock_file(&log_lock);
+ }
}
static void process_log_file_at_exit(void)
@@ -113,6 +133,8 @@ static void gc_config(void)
git_config_get_bool("gc.autodetach", &detach_auto);
git_config_date_string("gc.pruneexpire", &prune_expire);
git_config_date_string("gc.worktreepruneexpire", &prune_worktrees_expire);
+ git_config_date_string("gc.logexpiry", &gc_log_expire);
+
git_config(git_default_config, NULL);
}
@@ -290,19 +312,34 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
static int report_last_gc_error(void)
{
struct strbuf sb = STRBUF_INIT;
- int ret;
+ int ret = 0;
+ struct stat st;
+ char *gc_log_path = git_pathdup("gc.log");
- ret = strbuf_read_file(&sb, git_path("gc.log"), 0);
+ if (stat(gc_log_path, &st)) {
+ if (errno == ENOENT)
+ goto done;
+
+ ret = error_errno(_("Can't stat %s"), gc_log_path);
+ goto done;
+ }
+
+ if (st.st_mtime < gc_log_expire_time)
+ goto done;
+
+ ret = strbuf_read_file(&sb, gc_log_path, 0);
if (ret > 0)
- return error(_("The last gc run reported the following. "
+ ret = error(_("The last gc run reported the following. "
"Please correct the root cause\n"
"and remove %s.\n"
"Automatic cleanup will not be performed "
"until the file is removed.\n\n"
"%s"),
- git_path("gc.log"), sb.buf);
+ gc_log_path, sb.buf);
strbuf_release(&sb);
- return 0;
+done:
+ free(gc_log_path);
+ return ret;
}
static int gc_before_repack(void)
@@ -349,7 +386,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
argv_array_pushl(&prune_worktrees, "worktree", "prune", "--expire", NULL);
argv_array_pushl(&rerere, "rerere", "gc", NULL);
+ /* default expiry time, overwritten in gc_config */
gc_config();
+ if (parse_expiry_date(gc_log_expire, &gc_log_expire_time))
+ die(_("Failed to parse gc.logexpiry value %s"), gc_log_expire);
if (pack_refs < 0)
pack_refs = !is_bare_repository();
@@ -448,5 +488,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
warning(_("There are too many unreachable loose objects; "
"run 'git prune' to remove them."));
+ if (!daemonized)
+ unlink(git_path("gc.log"));
+
return 0;
}
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index 1762dfa6a..08de2e8ab 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -67,5 +67,20 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre
test_line_count = 2 new # There is one new pack and its .idx
'
+test_expect_success 'background auto gc does not run if gc.log is present and recent but does if it is old' '
+ test_commit foo &&
+ test_commit bar &&
+ git repack &&
+ test_config gc.autopacklimit 1 &&
+ test_config gc.autodetach true &&
+ echo fleem >.git/gc.log &&
+ test_must_fail git gc --auto 2>err &&
+ test_i18ngrep "^error:" err &&
+ test_config gc.logexpiry 5.days &&
+ test-chmtime =-345600 .git/gc.log &&
+ test_must_fail git gc --auto &&
+ test_config gc.logexpiry 2.days &&
+ git gc --auto
+'
test_done
--
2.11.GIT
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox