* Re: What's cooking in git.git (Dec 2016, #07; Thu, 22)
From: Duy Nguyen @ 2016-12-23 10:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
In-Reply-To: <xmqqzijnehgb.fsf@gitster.mtv.corp.google.com>
On Fri, Dec 23, 2016 at 5:18 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Will merge to 'next'.
> - nd/config-misc-fixes 12-22 #3
Hold it. You made a comment about rollback lockfile on uninitialized
variable or something but I haven't time to really look at it yet.
--
Duy
^ permalink raw reply
* Re: [PATCH v2 1/3] mingw: adjust is_console() to work with stdin
From: Johannes Schindelin @ 2016-12-23 9:30 UTC (permalink / raw)
To: Beat Bolli; +Cc: git, Junio C Hamano, Pranit Bauva, Johannes Sixt
In-Reply-To: <fc3e0d9c-86ea-4a62-6b70-b9cdd67f581a@drbeat.li>
Hi Beat,
On Fri, 23 Dec 2016, Beat Bolli wrote:
> On 22.12.16 18:08, Johannes Schindelin wrote:
> > diff --git a/compat/winansi.c b/compat/winansi.c
> > index cb725fb02f..590d61cb1b 100644
> > --- a/compat/winansi.c
> > +++ b/compat/winansi.c
> > @@ -84,6 +84,7 @@ static void warn_if_raster_font(void)
> > static int is_console(int fd)
> > {
> > CONSOLE_SCREEN_BUFFER_INFO sbi;
> > + DWORD mode;
>
> Nit: can we move this definition into the block below where it's used?
>
> > HANDLE hcon;
> >
> > static int initialized = 0;
> > @@ -98,7 +99,10 @@ static int is_console(int fd)
> > return 0;
> >
> > /* check if its a handle to a console output screen buffer */
> > - if (!GetConsoleScreenBufferInfo(hcon, &sbi))
> > + if (!fd) {
>
> Right here:
> + DWORD mode;
By that reasoning, the CONSOLE_SCREEN_BUFFER_INFO declaration that has
function-wide scope should also move below:
> > + if (!GetConsoleMode(hcon, &mode))
> > + return 0;
Right here.
> > + } else if (!GetConsoleScreenBufferInfo(hcon, &sbi))
> > return 0;
> >
> > /* initialize attributes */
As the existing code followed a different convention, so does my patch.
If you choose to submit a change that moved the `mode` declaration to
narrow its scope, please also move the `sbi` declaration for consistency.
Ciao,
Dscho
^ permalink raw reply
* Re: [RFC/PATCH] add diffstat information to rebase
From: Jacob Keller @ 2016-12-23 8:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Stefan Beller, Git mailing list
In-Reply-To: <xmqqtw9vegjr.fsf@gitster.mtv.corp.google.com>
On Thu, Dec 22, 2016 at 2:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>> $ git rebase -i HEAD^^
>>
>> pick 2eaa3f532c Third batch for 2.12
>> # Documentation/RelNotes/2.12.0.txt | 40 +++++++++++++++++++++++++++++++++++++++
>> # 1 file changed, 40 insertions(+)
>> pick 3170a3a57b add information to rebase
>> # git-rebase--interactive.sh | 2 ++
>> # 1 file changed, 2 insertions(+)
>>
>> # Rebase 2eaa3f532c..3170a3a57b onto 2eaa3f532c (1 command)
>> #
>> # Commands:
>> # p, pick = use commit
>> # r, reword = use commit, but edit the commit message
>> # e, edit = use commit, but stop for amending
>>
>> I am not completely satisfied with the result, as I initially wished these
>> information would just appear in line after the commit subject, but this
>> comes close. Maybe the last line also needs to be dropped.
>
> This is an interesting and thought-provoking idea ;-).
>
> In practice, you would probably be touching the same file over and
> over again in the series you are rebasing, when you are doing "many
> miniscule commits recording experiments and dead ends, with an
> intention to clean it up later", and by definition, your subject
> lines are useless series of "oops", "fix", etc. The subject and
> list of filenames would probably not make a good "summary" of the
> changes for each commit.
>
> Stepping back a bit, right now, when the user asks "git commit" to
> supply material to help writing a good commit message, we punt on
> mechanically generating a good summary and instead just show output
> of "diff --cached". If we can come up with a way to mechanically
> generate a concise summary for the purpose of annotating "rebase -i"
> instruction, we probably can reuse that and append it at the end of
> the log editor "git commit" spawns when it is run without "-v".
>
I really like this idea, though I'm not sure exactly what a good
heuristic would be? A short summary of all diff "function headers"
could be valuable, as could file names. It would obviously be a
heuristic of some kind.
> Also, this makes me wonder if the ideal endgame might be to depend
> on the current "rebase -i" UI as little as possible.
>
I think this type of short summary could be valuable in lots of places yes.
> "rebase -i" is "interactive" only to the extent that you can
> interact in your text editor the order and the fashion in which the
> changes are applied. If we instead teach either gitk or tig to
> easily allow you to "tick" each commit you see in their UI and
> generate the instruction used by the sequencer, and feed that and
> actually drive the sequencer to execute it (perhaps inside a
> temporary/throwaway working tree) while you are still in gitk or tig
> and reload the UI dynamically to let you view the result, the
> overall user experience would become a lot more "interactive".
>
Thanks,
Jake
^ permalink raw reply
* Re: [PATCH] diff: prefer indent heuristic over compaction heuristic
From: Jacob Keller @ 2016-12-23 8:12 UTC (permalink / raw)
To: Jeff King
Cc: Junio C Hamano, Michael Haggerty, Jacob Keller, Git mailing list,
Norbert Kiesel
In-Reply-To: <20161223072201.zw2lwkdcs6qmb4rp@sigill.intra.peff.net>
On Thu, Dec 22, 2016 at 11:22 PM, Jeff King <peff@peff.net> wrote:
> On Thu, Dec 22, 2016 at 01:12:12PM -0800, Junio C Hamano wrote:
>
>> Jacob Keller <jacob.keller@gmail.com> writes:
>>
>> > I don't think we have too many config options that interact in this
>> > way, so I understand that "last writing of a particular configuration"
>> > makes sense, but interactions between configs is something that would
>> > have never occurred to me. I'll send a patch to drop the compaction
>> > heuristic since I think we're all 100% in agreement that it is
>> > superseded by the new configuration (as no case has been shown where
>> > the new one is worse than compaction, and most show it to be better).
>>
>> If I recall correctly, we agreed that we'll drop the implementation
>> of compaction, but use the name --compaction-heuristics to trigger
>> the new and improved "indent heuristics":
>>
>> <20161101205916.d74n6lhgp2hexpzr@sigill.intra.peff.net>
>
> FWIW, I was swayed in the other direction by later messages in the
> thread. Especially your noting that the "compaction" name has always
> been labeled experimental, and Michael's argument in:
>
> http://public-inbox.org/git/8dbbd28b-af60-5e66-ae27-d7cddca233dc@alum.mit.edu/
>
> I.e., we could keep calling it "--indent-heuristic", and probably drop
> the other heuristic entirely as a failed experiment.
>
> I can live with it either way, but since I am being quoted as the source
> of the suggestion, I feel like that's an invitation to add my 2 cents. :)
>
> Liberal quoting below since I am adding Michael to the cc list.
>
> -Peff
>
I actually would prefer that we just say "this is the default now" and
provide some knob "no-indent-heuristic" or "no-compaction-heuristic"
and go with that, I think, since I am pretty sure we're all in
agreement that the heuristic is an improvement in almost every case,
certainly all the ones we've found. It's at least not worse in any
case I've seen, and is usually better.
Thoughts? I don't have a super strong opinion about which name we went
with for the knob.
Thanks,
Jake
^ permalink raw reply
* Re: [PATCH] diff: prefer indent heuristic over compaction heuristic
From: Jeff King @ 2016-12-23 7:22 UTC (permalink / raw)
To: Junio C Hamano
Cc: Michael Haggerty, Jacob Keller, Jacob Keller, Git mailing list,
Norbert Kiesel
In-Reply-To: <xmqqinqbfz2r.fsf@gitster.mtv.corp.google.com>
On Thu, Dec 22, 2016 at 01:12:12PM -0800, Junio C Hamano wrote:
> Jacob Keller <jacob.keller@gmail.com> writes:
>
> > I don't think we have too many config options that interact in this
> > way, so I understand that "last writing of a particular configuration"
> > makes sense, but interactions between configs is something that would
> > have never occurred to me. I'll send a patch to drop the compaction
> > heuristic since I think we're all 100% in agreement that it is
> > superseded by the new configuration (as no case has been shown where
> > the new one is worse than compaction, and most show it to be better).
>
> If I recall correctly, we agreed that we'll drop the implementation
> of compaction, but use the name --compaction-heuristics to trigger
> the new and improved "indent heuristics":
>
> <20161101205916.d74n6lhgp2hexpzr@sigill.intra.peff.net>
FWIW, I was swayed in the other direction by later messages in the
thread. Especially your noting that the "compaction" name has always
been labeled experimental, and Michael's argument in:
http://public-inbox.org/git/8dbbd28b-af60-5e66-ae27-d7cddca233dc@alum.mit.edu/
I.e., we could keep calling it "--indent-heuristic", and probably drop
the other heuristic entirely as a failed experiment.
I can live with it either way, but since I am being quoted as the source
of the suggestion, I feel like that's an invitation to add my 2 cents. :)
Liberal quoting below since I am adding Michael to the cc list.
-Peff
> So let's do this.
>
> -- >8 --
> Subject: [PATCH] diff: retire the original experimental "compaction" heuristics
>
> This retires the experimental "compaction" heuristics but with a
> twist. It removes the mention of "indent" heuristics, which was a
> competing experiment, from everywhere, guts the core logic of the
> original "compaction" heuristics out and replaces it with the logic
> used by the "indent" heuristics.
>
> The externally visible effect of this change is that people who have
> been experimenting by setting diff.compactionHeuristic configuration
> or giving the command line option --compaction-heuristic will start
> getting the behaviour based on the improved heuristics that used to
> be called "indent" heuristics.
>
> Suggested-by: Jeff King <peff@peff.net>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> Documentation/diff-config.txt | 6 ++---
> Documentation/diff-heuristic-options.txt | 2 --
> builtin/blame.c | 3 +--
> diff.c | 25 ++++-----------------
> git-add--interactive.perl | 5 +----
> t/t4061-diff-indent.sh | 38 ++++++++++++++++----------------
> xdiff/xdiff.h | 1 -
> xdiff/xdiffi.c | 37 +++----------------------------
> 8 files changed, 30 insertions(+), 87 deletions(-)
>
> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
> index 58f4bd6afa..39fff3aef9 100644
> --- a/Documentation/diff-config.txt
> +++ b/Documentation/diff-config.txt
> @@ -171,11 +171,9 @@ diff.tool::
>
> include::mergetools-diff.txt[]
>
> -diff.indentHeuristic::
> diff.compactionHeuristic::
> - Set one of these options to `true` to enable one of two
> - experimental heuristics that shift diff hunk boundaries to
> - make patches easier to read.
> + Set this option to `true` to enable experimental heuristics
> + that shift diff hunk boundaries to make patches easier to read.
>
> diff.algorithm::
> Choose a diff algorithm. The variants are as follows:
> diff --git a/Documentation/diff-heuristic-options.txt b/Documentation/diff-heuristic-options.txt
> index 36cb549df9..3cb024aa22 100644
> --- a/Documentation/diff-heuristic-options.txt
> +++ b/Documentation/diff-heuristic-options.txt
> @@ -1,5 +1,3 @@
> ---indent-heuristic::
> ---no-indent-heuristic::
> --compaction-heuristic::
> --no-compaction-heuristic::
> These are to help debugging and tuning experimental heuristics
> diff --git a/builtin/blame.c b/builtin/blame.c
> index 4ddfadb71f..395d4011fb 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -2596,7 +2596,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
> * and are only included here to get included in the "-h"
> * output:
> */
> - { OPTION_LOWLEVEL_CALLBACK, 0, "indent-heuristic", NULL, NULL, N_("Use an experimental indent-based heuristic to improve diffs"), PARSE_OPT_NOARG, parse_opt_unknown_cb },
> { OPTION_LOWLEVEL_CALLBACK, 0, "compaction-heuristic", NULL, NULL, N_("Use an experimental blank-line-based heuristic to improve diffs"), PARSE_OPT_NOARG, parse_opt_unknown_cb },
>
> OPT_BIT(0, "minimal", &xdl_opts, N_("Spend extra cycles to find better match"), XDF_NEED_MINIMAL),
> @@ -2645,7 +2644,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
> }
> parse_done:
> no_whole_file_rename = !DIFF_OPT_TST(&revs.diffopt, FOLLOW_RENAMES);
> - xdl_opts |= revs.diffopt.xdl_opts & (XDF_COMPACTION_HEURISTIC | XDF_INDENT_HEURISTIC);
> + xdl_opts |= revs.diffopt.xdl_opts & XDF_COMPACTION_HEURISTIC;
> DIFF_OPT_CLR(&revs.diffopt, FOLLOW_RENAMES);
> argc = parse_options_end(&ctx);
>
> diff --git a/diff.c b/diff.c
> index 8981477c43..f1b01f5b1e 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -27,7 +27,6 @@
> #endif
>
> static int diff_detect_rename_default;
> -static int diff_indent_heuristic; /* experimental */
> static int diff_compaction_heuristic; /* experimental */
> static int diff_rename_limit_default = 400;
> static int diff_suppress_blank_empty;
> @@ -223,16 +222,8 @@ void init_diff_ui_defaults(void)
>
> int git_diff_heuristic_config(const char *var, const char *value, void *cb)
> {
> - if (!strcmp(var, "diff.indentheuristic")) {
> - diff_indent_heuristic = git_config_bool(var, value);
> - if (diff_indent_heuristic)
> - diff_compaction_heuristic = 0;
> - }
> - if (!strcmp(var, "diff.compactionheuristic")) {
> + if (!strcmp(var, "diff.compactionheuristic"))
> diff_compaction_heuristic = git_config_bool(var, value);
> - if (diff_compaction_heuristic)
> - diff_indent_heuristic = 0;
> - }
> return 0;
> }
>
> @@ -3378,9 +3369,7 @@ void diff_setup(struct diff_options *options)
> options->use_color = diff_use_color_default;
> options->detect_rename = diff_detect_rename_default;
> options->xdl_opts |= diff_algorithm;
> - if (diff_indent_heuristic)
> - DIFF_XDL_SET(options, INDENT_HEURISTIC);
> - else if (diff_compaction_heuristic)
> + if (diff_compaction_heuristic)
> DIFF_XDL_SET(options, COMPACTION_HEURISTIC);
>
> options->orderfile = diff_order_file_cfg;
> @@ -3876,15 +3865,9 @@ int diff_opt_parse(struct diff_options *options,
> DIFF_XDL_SET(options, IGNORE_WHITESPACE_AT_EOL);
> else if (!strcmp(arg, "--ignore-blank-lines"))
> DIFF_XDL_SET(options, IGNORE_BLANK_LINES);
> - else if (!strcmp(arg, "--indent-heuristic")) {
> - DIFF_XDL_SET(options, INDENT_HEURISTIC);
> - DIFF_XDL_CLR(options, COMPACTION_HEURISTIC);
> - } else if (!strcmp(arg, "--no-indent-heuristic"))
> - DIFF_XDL_CLR(options, INDENT_HEURISTIC);
> - else if (!strcmp(arg, "--compaction-heuristic")) {
> + else if (!strcmp(arg, "--compaction-heuristic"))
> DIFF_XDL_SET(options, COMPACTION_HEURISTIC);
> - DIFF_XDL_CLR(options, INDENT_HEURISTIC);
> - } else if (!strcmp(arg, "--no-compaction-heuristic"))
> + else if (!strcmp(arg, "--no-compaction-heuristic"))
> DIFF_XDL_CLR(options, COMPACTION_HEURISTIC);
> else if (!strcmp(arg, "--patience"))
> options->xdl_opts = DIFF_WITH_ALG(options, PATIENCE_DIFF);
> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index ee3d812695..642cce1ac6 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -45,7 +45,6 @@
> my $normal_color = $repo->get_color("", "reset");
>
> my $diff_algorithm = $repo->config('diff.algorithm');
> -my $diff_indent_heuristic = $repo->config_bool('diff.indentheuristic');
> my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic');
> my $diff_filter = $repo->config('interactive.difffilter');
>
> @@ -751,9 +750,7 @@ sub parse_diff {
> if (defined $diff_algorithm) {
> splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
> }
> - if ($diff_indent_heuristic) {
> - splice @diff_cmd, 1, 0, "--indent-heuristic";
> - } elsif ($diff_compaction_heuristic) {
> + if ($diff_compaction_heuristic) {
> splice @diff_cmd, 1, 0, "--compaction-heuristic";
> }
> if (defined $patch_mode_revision) {
> diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
> index 556450609b..30f809d0d3 100755
> --- a/t/t4061-diff-indent.sh
> +++ b/t/t4061-diff-indent.sh
> @@ -1,6 +1,6 @@
> #!/bin/sh
>
> -test_description='Test diff indent heuristic.
> +test_description='Test diff compaction heuristic.
>
> '
> . ./test-lib.sh
> @@ -157,28 +157,28 @@ test_expect_success 'diff: ugly spaces' '
> compare_diff spaces-expect out
> '
>
> -test_expect_success 'diff: nice spaces with --indent-heuristic' '
> - git diff --indent-heuristic old new -- spaces.txt >out-compacted &&
> +test_expect_success 'diff: nice spaces with --compaction-heuristic' '
> + git diff --compaction-heuristic old new -- spaces.txt >out-compacted &&
> compare_diff spaces-compacted-expect out-compacted
> '
>
> -test_expect_success 'diff: nice spaces with diff.indentHeuristic' '
> - git -c diff.indentHeuristic=true diff old new -- spaces.txt >out-compacted2 &&
> +test_expect_success 'diff: nice spaces with diff.compactionHeuristic' '
> + git -c diff.compactionHeuristic=true diff old new -- spaces.txt >out-compacted2 &&
> compare_diff spaces-compacted-expect out-compacted2
> '
>
> -test_expect_success 'diff: --no-indent-heuristic overrides config' '
> - git -c diff.indentHeuristic=true diff --no-indent-heuristic old new -- spaces.txt >out2 &&
> +test_expect_success 'diff: --no-compaction-heuristic overrides config' '
> + git -c diff.compactionHeuristic=true diff --no-compaction-heuristic old new -- spaces.txt >out2 &&
> compare_diff spaces-expect out2
> '
>
> -test_expect_success 'diff: --indent-heuristic with --patience' '
> - git diff --indent-heuristic --patience old new -- spaces.txt >out-compacted3 &&
> +test_expect_success 'diff: --compaction-heuristic with --patience' '
> + git diff --compaction-heuristic --patience old new -- spaces.txt >out-compacted3 &&
> compare_diff spaces-compacted-expect out-compacted3
> '
>
> -test_expect_success 'diff: --indent-heuristic with --histogram' '
> - git diff --indent-heuristic --histogram old new -- spaces.txt >out-compacted4 &&
> +test_expect_success 'diff: --compaction-heuristic with --histogram' '
> + git diff --compaction-heuristic --histogram old new -- spaces.txt >out-compacted4 &&
> compare_diff spaces-compacted-expect out-compacted4
> '
>
> @@ -187,8 +187,8 @@ test_expect_success 'diff: ugly functions' '
> compare_diff functions-expect out
> '
>
> -test_expect_success 'diff: nice functions with --indent-heuristic' '
> - git diff --indent-heuristic old new -- functions.c >out-compacted &&
> +test_expect_success 'diff: nice functions with --compaction-heuristic' '
> + git diff --compaction-heuristic old new -- functions.c >out-compacted &&
> compare_diff functions-compacted-expect out-compacted
> '
>
> @@ -197,18 +197,18 @@ test_expect_success 'blame: ugly spaces' '
> compare_blame spaces-expect out-blame
> '
>
> -test_expect_success 'blame: nice spaces with --indent-heuristic' '
> - git blame --indent-heuristic old..new -- spaces.txt >out-blame-compacted &&
> +test_expect_success 'blame: nice spaces with --compaction-heuristic' '
> + git blame --compaction-heuristic old..new -- spaces.txt >out-blame-compacted &&
> compare_blame spaces-compacted-expect out-blame-compacted
> '
>
> -test_expect_success 'blame: nice spaces with diff.indentHeuristic' '
> - git -c diff.indentHeuristic=true blame old..new -- spaces.txt >out-blame-compacted2 &&
> +test_expect_success 'blame: nice spaces with diff.compactionHeuristic' '
> + git -c diff.compactionHeuristic=true blame old..new -- spaces.txt >out-blame-compacted2 &&
> compare_blame spaces-compacted-expect out-blame-compacted2
> '
>
> -test_expect_success 'blame: --no-indent-heuristic overrides config' '
> - git -c diff.indentHeuristic=true blame --no-indent-heuristic old..new -- spaces.txt >out-blame2 &&
> +test_expect_success 'blame: --no-compaction-heuristic overrides config' '
> + git -c diff.compactionHeuristic=true blame --no-compaction-heuristic old..new -- spaces.txt >out-blame2 &&
> git blame old..new -- spaces.txt >out-blame &&
> compare_blame spaces-expect out-blame2
> '
> diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
> index 8db16d4ae6..7423f77fc8 100644
> --- a/xdiff/xdiff.h
> +++ b/xdiff/xdiff.h
> @@ -42,7 +42,6 @@ extern "C" {
> #define XDF_IGNORE_BLANK_LINES (1 << 7)
>
> #define XDF_COMPACTION_HEURISTIC (1 << 8)
> -#define XDF_INDENT_HEURISTIC (1 << 9)
>
> #define XDL_EMIT_FUNCNAMES (1 << 0)
> #define XDL_EMIT_FUNCCONTEXT (1 << 2)
> diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
> index 760fbb6db7..2131ea4920 100644
> --- a/xdiff/xdiffi.c
> +++ b/xdiff/xdiffi.c
> @@ -400,11 +400,6 @@ static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1,
> }
>
>
> -static int is_blank_line(xrecord_t *rec, long flags)
> -{
> - return xdl_blankline(rec->ptr, rec->size, flags);
> -}
> -
> static int recs_match(xrecord_t *rec1, xrecord_t *rec2, long flags)
> {
> return (rec1->ha == rec2->ha &&
> @@ -821,7 +816,6 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
> struct xdlgroup g, go;
> long earliest_end, end_matching_other;
> long groupsize;
> - unsigned int blank_lines;
>
> group_init(xdf, &g);
> group_init(xdfo, &go);
> @@ -846,13 +840,6 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
> */
> end_matching_other = -1;
>
> - /*
> - * Boolean value that records whether there are any blank
> - * lines that could be made to be the last line of this
> - * group.
> - */
> - blank_lines = 0;
> -
> /* Shift the group backward as much as possible: */
> while (!group_slide_up(xdf, &g, flags))
> if (group_previous(xdfo, &go))
> @@ -869,11 +856,6 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
>
> /* Now shift the group forward as far as possible: */
> while (1) {
> - if (!blank_lines)
> - blank_lines = is_blank_line(
> - xdf->recs[g.end - 1],
> - flags);
> -
> if (group_slide_down(xdf, &g, flags))
> break;
> if (group_next(xdfo, &go))
> @@ -906,24 +888,11 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
> if (group_previous(xdfo, &go))
> xdl_bug("group sync broken sliding to match");
> }
> - } else if ((flags & XDF_COMPACTION_HEURISTIC) && blank_lines) {
> + } else if (flags & XDF_COMPACTION_HEURISTIC) {
> /*
> - * Compaction heuristic: if it is possible to shift the
> - * group to make its bottom line a blank line, do so.
> + * Heuristic based on the indentation level.
> *
> - * As we already shifted the group forward as far as
> - * possible in the earlier loop, we only need to handle
> - * backward shifts, not forward ones.
> - */
> - while (!is_blank_line(xdf->recs[g.end - 1], flags)) {
> - if (group_slide_up(xdf, &g, flags))
> - xdl_bug("blank line disappeared");
> - if (group_previous(xdfo, &go))
> - xdl_bug("group sync broken sliding to blank line");
> - }
> - } else if (flags & XDF_INDENT_HEURISTIC) {
> - /*
> - * Indent heuristic: a group of pure add/delete lines
> + * A group of pure add/delete lines
> * implies two splits, one between the end of the "before"
> * context and the start of the group, and another between
> * the end of the group and the beginning of the "after"
> --
> 2.11.0-448-g9a11f8a62b
>
^ permalink raw reply
* Re: [PATCH] git-svn: escape backslashes in refnames
From: Michael Fladischer @ 2016-12-23 7:06 UTC (permalink / raw)
To: Eric Wong; +Cc: git, Junio C Hamano
In-Reply-To: <20161223014202.GA8327@starla>
[-- Attachment #1.1: Type: text/plain, Size: 230 bytes --]
On 2016-12-23 02:42, Eric Wong wrote:
> Hi Michael, the patch below should fix things up.
Thank you Eric, I was able to successfully fetch the SVN tag with your
patch applied.
Cheers,
--
Michael Fladischer
Fladi.at
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* [PATCH] git-svn: escape backslashes in refnames
From: Eric Wong @ 2016-12-23 1:42 UTC (permalink / raw)
To: Michael Fladischer; +Cc: git, Junio C Hamano
In-Reply-To: <cb8cd9b1-9882-64d2-435d-40d0b2b82d59@fladi.at>
Hi Michael, the patch below should fix things up.
Junio: this should go to 'maint', pull request below.
----------------8<---------------
Subject: [PATCH] git-svn: escape backslashes in refnames
This brings git-svn refname escaping up-to-date with
commit a4c2e69936df8dd0b071b85664c6cc6a4870dd84
("Disallow '\' in ref names") from May 2009.
Reported-by: Michael Fladischer <michael@fladi.at>
Message-ID: <cb8cd9b1-9882-64d2-435d-40d0b2b82d59@fladi.at>
Signed-off-by: Eric Wong <e@80x24.org>
---
The following changes since commit a274e0a036ea886a31f8b216564ab1b4a3142f6c:
Sync with maint-2.10 (2016-12-05 11:25:47 -0800)
are available in the git repository at:
git://bogomips.org/git-svn.git svn-escape-backslash
for you to fetch changes up to 22af6fef9b6538c9e87e147a920be9509acf1ddd:
git-svn: escape backslashes in refnames (2016-12-23 01:37:36 +0000)
----------------------------------------------------------------
Eric Wong (1):
git-svn: escape backslashes in refnames
perl/Git/SVN.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 711d2687a3..98518f4ddb 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -490,7 +490,7 @@ sub refname {
#
# Additionally, % must be escaped because it is used for escaping
# and we want our escaped refname to be reversible
- $refname =~ s{([ \%~\^:\?\*\[\t])}{sprintf('%%%02X',ord($1))}eg;
+ $refname =~ s{([ \%~\^:\?\*\[\t\\])}{sprintf('%%%02X',ord($1))}eg;
# no slash-separated component can begin with a dot .
# /.* becomes /%2E*
--
EW
^ permalink raw reply related
* Re: Feature request: git rebase --no-edit --continue
From: Daniel Chumak @ 2016-12-22 23:22 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.2.20.1612230006530.155951@virtualbox>
Uff, I forgot about the CC of my last reply.
>
> Why not
>
> git commit -C HEAD && git rebase --continue
>
> ?
>
> Ciao,
> Johannes
Thanks this is a cleaner solution. I guess because I was too fixed upon
knowing of the existence of the no-edit option from other git commands
that I forget about this, even though I am using it quite often.
^ permalink raw reply
* Re: [PATCH v2 3/3] mingw: replace isatty() hack
From: Johannes Schindelin @ 2016-12-22 23:18 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, Jeff Hostetler, Junio C Hamano, Pranit Bauva, Beat Bolli
In-Reply-To: <04859cf9-e67a-28ab-ccb3-249687e696c8@kdbg.org>
Hi Hannes,
On Thu, 22 Dec 2016, Johannes Sixt wrote:
> Am 22.12.2016 um 22:37 schrieb Johannes Schindelin:
>
> > Would you have a suggestion how to rephrase the comment to make it
> > less confusing?
>
> Perhaps
>
> * This might close the cached console handle.
> * We must cache the live duplicate instead.
>
> Then update the cache before the dup2, because at this time all 3 of console,
> handle, and duplicate are live and cannot be recycled:
>
> if (console == handle)
> console = duplicate;
> dup2(new_fd, fd);
Good point. I reworded the comment slightly differently (see the interdiff
in v3 0/3), hope you don't mind.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH v2 1/3] mingw: adjust is_console() to work with stdin
From: Junio C Hamano @ 2016-12-22 23:18 UTC (permalink / raw)
To: Beat Bolli; +Cc: Johannes Schindelin, git, Pranit Bauva, Johannes Sixt
In-Reply-To: <fc3e0d9c-86ea-4a62-6b70-b9cdd67f581a@drbeat.li>
Beat Bolli <dev+git@drbeat.li> writes:
>> @@ -84,6 +84,7 @@ static void warn_if_raster_font(void)
>> static int is_console(int fd)
>> {
>> CONSOLE_SCREEN_BUFFER_INFO sbi;
>> + DWORD mode;
>
> Nit: can we move this definition into the block below where it's used?
>
>> HANDLE hcon;
>>
>> static int initialized = 0;
>> @@ -98,7 +99,10 @@ static int is_console(int fd)
>> return 0;
>>
>> /* check if its a handle to a console output screen buffer */
>> - if (!GetConsoleScreenBufferInfo(hcon, &sbi))
>> + if (!fd) {
>
> Right here:
> + DWORD mode;
>
>> + if (!GetConsoleMode(hcon, &mode))
>> + return 0;
>> + } else if (!GetConsoleScreenBufferInfo(hcon, &sbi))
>> return 0;
As these patches have been already merged to 'next' a few hours ago
as part of today's integration cycle, please make any further
refinement (if necessary) as incremental updates.
Thanks.
^ permalink raw reply
* [PATCH v3 3/3] mingw: replace isatty() hack
From: Johannes Schindelin @ 2016-12-22 23:16 UTC (permalink / raw)
To: git; +Cc: Jeff Hostetler, Junio C Hamano, Pranit Bauva, Johannes Sixt,
Beat Bolli
In-Reply-To: <cover.1482448531.git.johannes.schindelin@gmx.de>
From: Jeff Hostetler <jeffhost@microsoft.com>
Git for Windows has carried a patch that depended on internals
of MSVC runtime, but it does not work correctly with recent MSVC
runtime. A replacement was written originally for compiling
with VC++. The patch in this message is a backport of that
replacement, and it also fixes the previous attempt to make
isatty() tell that /dev/null is *not* an interactive terminal.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Tested-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
compat/winansi.c | 181 +++++++++++++++++++++----------------------------------
1 file changed, 70 insertions(+), 111 deletions(-)
diff --git a/compat/winansi.c b/compat/winansi.c
index fa37695fca..56658ec4f8 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -6,9 +6,12 @@
#include "../git-compat-util.h"
#include <wingdi.h>
#include <winreg.h>
+#include "win32.h"
-/* In this file, we actually want to use Windows' own isatty(). */
-#undef isatty
+static int fd_is_interactive[3] = { 0, 0, 0 };
+#define FD_CONSOLE 0x1
+#define FD_SWAPPED 0x2
+#define FD_MSYS 0x4
/*
ANSI codes used by git: m, K
@@ -105,6 +108,9 @@ static int is_console(int fd)
} else if (!GetConsoleScreenBufferInfo(hcon, &sbi))
return 0;
+ if (fd >= 0 && fd <= 2)
+ fd_is_interactive[fd] |= FD_CONSOLE;
+
/* initialize attributes */
if (!initialized) {
console = hcon;
@@ -466,76 +472,47 @@ static HANDLE duplicate_handle(HANDLE hnd)
return hresult;
}
-
-/*
- * Make MSVCRT's internal file descriptor control structure accessible
- * so that we can tweak OS handles and flags directly (we need MSVCRT
- * to treat our pipe handle as if it were a console).
- *
- * We assume that the ioinfo structure (exposed by MSVCRT.dll via
- * __pioinfo) starts with the OS handle and the flags. The exact size
- * varies between MSVCRT versions, so we try different sizes until
- * toggling the FDEV bit of _pioinfo(1)->osflags is reflected in
- * isatty(1).
- */
-typedef struct {
- HANDLE osfhnd;
- char osflags;
-} ioinfo;
-
-extern __declspec(dllimport) ioinfo *__pioinfo[];
-
-static size_t sizeof_ioinfo = 0;
-
-#define IOINFO_L2E 5
-#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
-
-#define FPIPE 0x08
-#define FDEV 0x40
-
-static inline ioinfo* _pioinfo(int fd)
-{
- return (ioinfo*)((char*)__pioinfo[fd >> IOINFO_L2E] +
- (fd & (IOINFO_ARRAY_ELTS - 1)) * sizeof_ioinfo);
-}
-
-static int init_sizeof_ioinfo(void)
-{
- int istty, wastty;
- /* don't init twice */
- if (sizeof_ioinfo)
- return sizeof_ioinfo >= 256;
-
- sizeof_ioinfo = sizeof(ioinfo);
- wastty = isatty(1);
- while (sizeof_ioinfo < 256) {
- /* toggle FDEV flag, check isatty, then toggle back */
- _pioinfo(1)->osflags ^= FDEV;
- istty = isatty(1);
- _pioinfo(1)->osflags ^= FDEV;
- /* return if we found the correct size */
- if (istty != wastty)
- return 0;
- sizeof_ioinfo += sizeof(void*);
- }
- error("Tweaking file descriptors doesn't work with this MSVCRT.dll");
- return 1;
-}
-
static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
{
- ioinfo *pioinfo;
- HANDLE old_handle;
-
- /* init ioinfo size if we haven't done so */
- if (init_sizeof_ioinfo())
- return INVALID_HANDLE_VALUE;
-
- /* get ioinfo pointer and change the handles */
- pioinfo = _pioinfo(fd);
- old_handle = pioinfo->osfhnd;
- pioinfo->osfhnd = new_handle;
- return old_handle;
+ /*
+ * Create a copy of the original handle associated with fd
+ * because the original will get closed when we dup2().
+ */
+ HANDLE handle = (HANDLE)_get_osfhandle(fd);
+ HANDLE duplicate = duplicate_handle(handle);
+
+ /* Create a temp fd associated with the already open "new_handle". */
+ int new_fd = _open_osfhandle((intptr_t)new_handle, O_BINARY);
+
+ assert((fd == 1) || (fd == 2));
+
+ /*
+ * Use stock dup2() to re-bind fd to the new handle. Note that
+ * this will implicitly close(1) and close both fd=1 and the
+ * originally associated handle. It will open a new fd=1 and
+ * call DuplicateHandle() on the handle associated with new_fd.
+ * It is because of this implicit close() that we created the
+ * copy of the original.
+ *
+ * Note that we need to update the cached console handle to the
+ * duplicated one because the dup2() call will implicitly close
+ * the original one.
+ *
+ * Note that dup2() when given target := {0,1,2} will also
+ * call SetStdHandle(), so we don't need to worry about that.
+ */
+ if (console == handle)
+ console = duplicate;
+ dup2(new_fd, fd);
+
+ /* Close the temp fd. This explicitly closes "new_handle"
+ * (because it has been associated with it).
+ */
+ close(new_fd);
+
+ fd_is_interactive[fd] |= FD_SWAPPED;
+
+ return duplicate;
}
#ifdef DETECT_MSYS_TTY
@@ -570,45 +547,25 @@ static void detect_msys_tty(int fd)
!wcsstr(name, L"-pty"))
return;
- /* init ioinfo size if we haven't done so */
- if (init_sizeof_ioinfo())
- return;
-
- /* set FDEV flag, reset FPIPE flag */
- _pioinfo(fd)->osflags &= ~FPIPE;
- _pioinfo(fd)->osflags |= FDEV;
+ fd_is_interactive[fd] |= FD_MSYS;
}
#endif
+/*
+ * Wrapper for isatty(). Most calls in the main git code
+ * call isatty(1 or 2) to see if the instance is interactive
+ * and should: be colored, show progress, paginate output.
+ * We lie and give results for what the descriptor WAS at
+ * startup (and ignore any pipe redirection we internally
+ * do).
+ */
+#undef isatty
int winansi_isatty(int fd)
{
- int res = isatty(fd);
-
- if (res) {
- /*
- * Make sure that /dev/null is not fooling Git into believing
- * that we are connected to a terminal, as "_isatty() returns a
- * nonzero value if the descriptor is associated with a
- * character device."; for more information, see
- *
- * https://msdn.microsoft.com/en-us/library/f4s0ddew.aspx
- */
- HANDLE handle = (HANDLE)_get_osfhandle(fd);
- if (fd == STDIN_FILENO) {
- DWORD dummy;
-
- if (!GetConsoleMode(handle, &dummy))
- res = 0;
- } else if (fd == STDOUT_FILENO || fd == STDERR_FILENO) {
- CONSOLE_SCREEN_BUFFER_INFO dummy;
-
- if (!GetConsoleScreenBufferInfo(handle, &dummy))
- res = 0;
- }
- }
-
- return res;
+ if (fd >= 0 && fd <= 2)
+ return fd_is_interactive[fd] != 0;
+ return isatty(fd);
}
void winansi_init(void)
@@ -619,6 +576,10 @@ void winansi_init(void)
/* check if either stdout or stderr is a console output screen buffer */
con1 = is_console(1);
con2 = is_console(2);
+
+ /* Also compute console bit for fd 0 even though we don't need the result here. */
+ is_console(0);
+
if (!con1 && !con2) {
#ifdef DETECT_MSYS_TTY
/* check if stdin / stdout / stderr are MSYS2 pty pipes */
@@ -662,12 +623,10 @@ void winansi_init(void)
*/
HANDLE winansi_get_osfhandle(int fd)
{
- HANDLE hnd = (HANDLE) _get_osfhandle(fd);
- if (isatty(fd) && GetFileType(hnd) == FILE_TYPE_PIPE) {
- if (fd == 1 && hconsole1)
- return hconsole1;
- else if (fd == 2 && hconsole2)
- return hconsole2;
- }
- return hnd;
+ if (fd == 1 && (fd_is_interactive[1] & FD_SWAPPED))
+ return hconsole1;
+ if (fd == 2 && (fd_is_interactive[2] & FD_SWAPPED))
+ return hconsole2;
+
+ return (HANDLE)_get_osfhandle(fd);
}
--
2.11.0.rc3.windows.1
^ permalink raw reply related
* [PATCH v3 2/3] mingw: fix colourization on Cygwin pseudo terminals
From: Johannes Schindelin @ 2016-12-22 23:16 UTC (permalink / raw)
To: git; +Cc: Alan Davies, Junio C Hamano, Pranit Bauva, Johannes Sixt,
Beat Bolli
In-Reply-To: <cover.1482448531.git.johannes.schindelin@gmx.de>
From: Alan Davies <alan.n.davies@gmail.com>
Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.
f7f90e0f4f (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.
The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.
Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).
This partially fixes https://github.com/git-for-windows/git/issues/267
Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
compat/winansi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/compat/winansi.c b/compat/winansi.c
index 590d61cb1b..fa37695fca 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -562,8 +562,12 @@ static void detect_msys_tty(int fd)
name = nameinfo->Name.Buffer;
name[nameinfo->Name.Length] = 0;
- /* check if this could be a MSYS2 pty pipe ('msys-XXXX-ptyN-XX') */
- if (!wcsstr(name, L"msys-") || !wcsstr(name, L"-pty"))
+ /*
+ * Check if this could be a MSYS2 pty pipe ('msys-XXXX-ptyN-XX')
+ * or a cygwin pty pipe ('cygwin-XXXX-ptyN-XX')
+ */
+ if ((!wcsstr(name, L"msys-") && !wcsstr(name, L"cygwin-")) ||
+ !wcsstr(name, L"-pty"))
return;
/* init ioinfo size if we haven't done so */
--
2.11.0.rc3.windows.1
^ permalink raw reply related
* [PATCH v3 1/3] mingw: adjust is_console() to work with stdin
From: Johannes Schindelin @ 2016-12-22 23:16 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Pranit Bauva, Johannes Sixt, Beat Bolli
In-Reply-To: <cover.1482448531.git.johannes.schindelin@gmx.de>
When determining whether a handle corresponds to a *real* Win32 Console
(as opposed to, say, a character device such as /dev/null), we use the
GetConsoleOutputBufferInfo() function as a tell-tale.
However, that does not work for *input* handles associated with a
console. Let's just use the GetConsoleMode() function for input handles,
and since it does not work on output handles fall back to the previous
method for those.
This patch prepares for using is_console() instead of my previous
misguided attempt in cbb3f3c9b1 (mingw: intercept isatty() to handle
/dev/null as Git expects it, 2016-12-11) that broke everything on
Windows.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
compat/winansi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/compat/winansi.c b/compat/winansi.c
index cb725fb02f..590d61cb1b 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -84,6 +84,7 @@ static void warn_if_raster_font(void)
static int is_console(int fd)
{
CONSOLE_SCREEN_BUFFER_INFO sbi;
+ DWORD mode;
HANDLE hcon;
static int initialized = 0;
@@ -98,7 +99,10 @@ static int is_console(int fd)
return 0;
/* check if its a handle to a console output screen buffer */
- if (!GetConsoleScreenBufferInfo(hcon, &sbi))
+ if (!fd) {
+ if (!GetConsoleMode(hcon, &mode))
+ return 0;
+ } else if (!GetConsoleScreenBufferInfo(hcon, &sbi))
return 0;
/* initialize attributes */
--
2.11.0.rc3.windows.1
^ permalink raw reply related
* [PATCH v3 0/3] Really fix the isatty() problem on Windows
From: Johannes Schindelin @ 2016-12-22 23:16 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Pranit Bauva, Johannes Sixt, Beat Bolli
In-Reply-To: <cover.1482426497.git.johannes.schindelin@gmx.de>
My previous fix may have fixed running the new
t/t6030-bisect-porcelain.sh script that tested the new bisect--helper,
which in turn used isatty() to determine whether it was running
interactively and was fooled by being redirected to /dev/null.
But it not only broke paging when running in a CMD window, due to
testing in the wrong worktree I also missed that it broke paging in Git
for Windows 2.x' Git Bash (i.e. a MinTTY terminal emulator).
Let's use this opportunity to actually clean up the entire isatty() mess
once and for all, as part of the problem was introduced by a clever hack
that messes with internals of the Microsoft C runtime, and which changed
recently, so it was not such a clever hack to begin with.
Happily, one of my colleagues had to address that latter problem
recently when he was tasked to make Git compile with Microsoft Visual C
(the rationale: debugging facilities of Visual Studio are really
outstanding, try them if you get a chance).
And incidentally, replacing the previous hack with the clean, new
solution, which specifies explicitly for the file descriptors 0, 1 and 2
whether we detected an MSYS2 pseudo-tty, whether we detected a real
Win32 Console, and whether we had to swap out a real Win32 Console for a
pipe to allow child processes to inherit it.
While at it (or, actually, more like: as I already made this part of v1
by mistake), upstream the patch carried in Git for Windows that supports
color when running Git for Windows in Cygwin terminals.
Changes since v2:
- reworded the comment about "recycling handles"
- moved the reassignment of the `console` variable before the dup2()
call so that it is valid at all times
- removed the "handle = INVALID_HANDLE_VALUE" assignment, as the local
variable `handle` is not used afterwards anyway
- generated the patches with --patience in the hope to improve
readability
Alan Davies (1):
mingw: fix colourization on Cygwin pseudo terminals
Jeff Hostetler (1):
mingw: replace isatty() hack
Johannes Schindelin (1):
mingw: adjust is_console() to work with stdin
compat/winansi.c | 195 +++++++++++++++++++++++--------------------------------
1 file changed, 81 insertions(+), 114 deletions(-)
base-commit: 1d1bdafd64266e5ee3bd46c6965228f32e4022ea
Published-As: https://github.com/dscho/git/releases/tag/mingw-isatty-fixup-v3
Fetch-It-Via: git fetch https://github.com/dscho/git mingw-isatty-fixup-v3
Interdiff vs v2:
diff --git a/compat/winansi.c b/compat/winansi.c
index 477209fce7..56658ec4f8 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -494,19 +494,16 @@ static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
* It is because of this implicit close() that we created the
* copy of the original.
*
- * Note that the OS can recycle HANDLE (numbers) just like it
- * recycles fd (numbers), so we must update the cached value
- * of "console". You can use GetFileType() to see that
- * handle and _get_osfhandle(fd) may have the same number
- * value, but they refer to different actual files now.
+ * Note that we need to update the cached console handle to the
+ * duplicated one because the dup2() call will implicitly close
+ * the original one.
*
* Note that dup2() when given target := {0,1,2} will also
* call SetStdHandle(), so we don't need to worry about that.
*/
- dup2(new_fd, fd);
if (console == handle)
console = duplicate;
- handle = INVALID_HANDLE_VALUE;
+ dup2(new_fd, fd);
/* Close the temp fd. This explicitly closes "new_handle"
* (because it has been associated with it).
--
2.11.0.rc3.windows.1
^ permalink raw reply
* Re: Feature request: git rebase --no-edit --continue
From: Johannes Schindelin @ 2016-12-22 23:07 UTC (permalink / raw)
To: Daniel Chumak; +Cc: git
In-Reply-To: <6ff2c5a3-fe81-0bec-ad9a-d62bdb4a176f@gmail.com>
Hi Daniel,
On Thu, 22 Dec 2016, Daniel Chumak wrote:
> Is there a reason why there is no '--no-edit' option for git rebase? I would
> like to use this option after editing a commit and continuing the current
> interactive rebase without having to change the commit message.
Why not
git commit -C HEAD && git rebase --continue
?
Ciao,
Johannes
^ permalink raw reply
* Re: [RFC/PATCH] add diffstat information to rebase
From: Johannes Schindelin @ 2016-12-22 23:05 UTC (permalink / raw)
To: Stefan Beller; +Cc: git
In-Reply-To: <20161222221327.7354-1-sbeller@google.com>
Hi Stefan,
On Thu, 22 Dec 2016, Stefan Beller wrote:
> *Ideally* I would rather have a different formatting, e.g. maybe:
>
> $ git checkout remotes/origin/js/sequencer-wo-die
> $ git rebase -i --new-magic v2.10.0-rc2^
>
> which produces:
>
> pick d5cb9cbd64 Git 2.10-rc2 | Documentation/RelNo.., GIT-VERSION-GEN -..(+5, -1)
> ...
That sounds more like a patch adding a new placeholder to the user formats
than a patch modifying rebase -i; by using rebase.instructionFormat you
can implement that "new magic", and the new functionality may even benefit
more obscure use cases.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH v2 1/3] mingw: adjust is_console() to work with stdin
From: Beat Bolli @ 2016-12-22 23:04 UTC (permalink / raw)
To: Johannes Schindelin, git; +Cc: Junio C Hamano, Pranit Bauva, Johannes Sixt
In-Reply-To: <ca4c61c603247c8ad0b876b068f6cd41fbe01667.1482426497.git.johannes.schindelin@gmx.de>
On 22.12.16 18:08, Johannes Schindelin wrote:
> When determining whether a handle corresponds to a *real* Win32 Console
> (as opposed to, say, a character device such as /dev/null), we use the
> GetConsoleOutputBufferInfo() function as a tell-tale.
>
> However, that does not work for *input* handles associated with a
> console. Let's just use the GetConsoleMode() function for input handles,
> and since it does not work on output handles fall back to the previous
> method for those.
>
> This patch prepares for using is_console() instead of my previous
> misguided attempt in cbb3f3c9b1 (mingw: intercept isatty() to handle
> /dev/null as Git expects it, 2016-12-11) that broke everything on
> Windows.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> compat/winansi.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/compat/winansi.c b/compat/winansi.c
> index cb725fb02f..590d61cb1b 100644
> --- a/compat/winansi.c
> +++ b/compat/winansi.c
> @@ -84,6 +84,7 @@ static void warn_if_raster_font(void)
> static int is_console(int fd)
> {
> CONSOLE_SCREEN_BUFFER_INFO sbi;
> + DWORD mode;
Nit: can we move this definition into the block below where it's used?
> HANDLE hcon;
>
> static int initialized = 0;
> @@ -98,7 +99,10 @@ static int is_console(int fd)
> return 0;
>
> /* check if its a handle to a console output screen buffer */
> - if (!GetConsoleScreenBufferInfo(hcon, &sbi))
> + if (!fd) {
Right here:
+ DWORD mode;
> + if (!GetConsoleMode(hcon, &mode))
> + return 0;
> + } else if (!GetConsoleScreenBufferInfo(hcon, &sbi))
> return 0;
>
> /* initialize attributes */
>
^ permalink raw reply
* Re: [PATCH] diff: prefer indent heuristic over compaction heuristic
From: Junio C Hamano @ 2016-12-22 22:43 UTC (permalink / raw)
To: Jacob Keller; +Cc: Jacob Keller, Git mailing list, Norbert Kiesel
In-Reply-To: <CA+P7+xrkp-qiUVmfeLUcaMP-RSDbH4u3vCjVoQN8=mhz25Cd3A@mail.gmail.com>
Jacob Keller <jacob.keller@gmail.com> writes:
>> { OPTION_LOWLEVEL_CALLBACK, 0, "compaction-heuristic", NULL, NULL, N_("Use an experimental blank-line-based heuristic to improve diffs"), PARSE_OPT_NOARG, parse_opt_unknown_cb },
>>
>
> The unchanged context line should have its description re-worded to
> something like "Use an experimental heuristic to improve diffs" as it
> no longer uses only blank lines.
Thanks. The final copy I pushed out has that change.
^ permalink raw reply
* Re: Feature request: git rebase --no-edit --continue
From: Stefan Beller @ 2016-12-22 22:38 UTC (permalink / raw)
To: Daniel Chumak; +Cc: git@vger.kernel.org
In-Reply-To: <6ff2c5a3-fe81-0bec-ad9a-d62bdb4a176f@gmail.com>
On Thu, Dec 22, 2016 at 2:35 PM, Daniel Chumak
<chumak.daniel.dev@gmail.com> wrote:
> Is there a reason why there is no '--no-edit' option for git rebase?
Nobody added it so far.
> I would
> like to use this option after editing a commit and continuing the current
> interactive rebase without having to change the commit message.
>
You're welcome to write a patch for it. :)
On the other hand you could just use
EDITOR=true git rebase --continue
^ permalink raw reply
* Re: [RFC/PATCH] add diffstat information to rebase
From: Junio C Hamano @ 2016-12-22 22:37 UTC (permalink / raw)
To: Stefan Beller; +Cc: git
In-Reply-To: <20161222185609.21139-1-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> $ git rebase -i HEAD^^
>
> pick 2eaa3f532c Third batch for 2.12
> # Documentation/RelNotes/2.12.0.txt | 40 +++++++++++++++++++++++++++++++++++++++
> # 1 file changed, 40 insertions(+)
> pick 3170a3a57b add information to rebase
> # git-rebase--interactive.sh | 2 ++
> # 1 file changed, 2 insertions(+)
>
> # Rebase 2eaa3f532c..3170a3a57b onto 2eaa3f532c (1 command)
> #
> # Commands:
> # p, pick = use commit
> # r, reword = use commit, but edit the commit message
> # e, edit = use commit, but stop for amending
>
> I am not completely satisfied with the result, as I initially wished these
> information would just appear in line after the commit subject, but this
> comes close. Maybe the last line also needs to be dropped.
This is an interesting and thought-provoking idea ;-).
In practice, you would probably be touching the same file over and
over again in the series you are rebasing, when you are doing "many
miniscule commits recording experiments and dead ends, with an
intention to clean it up later", and by definition, your subject
lines are useless series of "oops", "fix", etc. The subject and
list of filenames would probably not make a good "summary" of the
changes for each commit.
Stepping back a bit, right now, when the user asks "git commit" to
supply material to help writing a good commit message, we punt on
mechanically generating a good summary and instead just show output
of "diff --cached". If we can come up with a way to mechanically
generate a concise summary for the purpose of annotating "rebase -i"
instruction, we probably can reuse that and append it at the end of
the log editor "git commit" spawns when it is run without "-v".
Also, this makes me wonder if the ideal endgame might be to depend
on the current "rebase -i" UI as little as possible.
"rebase -i" is "interactive" only to the extent that you can
interact in your text editor the order and the fashion in which the
changes are applied. If we instead teach either gitk or tig to
easily allow you to "tick" each commit you see in their UI and
generate the instruction used by the sequencer, and feed that and
actually drive the sequencer to execute it (perhaps inside a
temporary/throwaway working tree) while you are still in gitk or tig
and reload the UI dynamically to let you view the result, the
overall user experience would become a lot more "interactive".
^ permalink raw reply
* Feature request: git rebase --no-edit --continue
From: Daniel Chumak @ 2016-12-22 22:35 UTC (permalink / raw)
To: git
Is there a reason why there is no '--no-edit' option for git rebase? I
would like to use this option after editing a commit and continuing the
current interactive rebase without having to change the commit message.
^ permalink raw reply
* Re: [PATCH v2 3/3] mingw: replace isatty() hack
From: Johannes Sixt @ 2016-12-22 22:28 UTC (permalink / raw)
To: Johannes Schindelin
Cc: git, Jeff Hostetler, Junio C Hamano, Pranit Bauva, Beat Bolli
In-Reply-To: <alpine.DEB.2.20.1612222235200.155951@virtualbox>
Am 22.12.2016 um 22:37 schrieb Johannes Schindelin:
> Hi Hannes,
>
> On Thu, 22 Dec 2016, Johannes Sixt wrote:
>
>> Am 22.12.2016 um 18:09 schrieb Johannes Schindelin:
>>> +static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
>>> +{
>>> + /*
>>> + * Create a copy of the original handle associated with fd
>>> + * because the original will get closed when we dup2().
>>> + */
>>> + HANDLE handle = (HANDLE)_get_osfhandle(fd);
>>> + HANDLE duplicate = duplicate_handle(handle);
>>>
>>> + /* Create a temp fd associated with the already open "new_handle". */
>>> + int new_fd = _open_osfhandle((intptr_t)new_handle, O_BINARY);
>>>
>>> + assert((fd == 1) || (fd == 2));
>>>
>>> + /*
>>> + * Use stock dup2() to re-bind fd to the new handle. Note that
>>> + * this will implicitly close(1) and close both fd=1 and the
>>> + * originally associated handle. It will open a new fd=1 and
>>> + * call DuplicateHandle() on the handle associated with new_fd.
>>> + * It is because of this implicit close() that we created the
>>> + * copy of the original.
>>> + *
>>> + * Note that the OS can recycle HANDLE (numbers) just like it
>>> + * recycles fd (numbers), so we must update the cached value
>>> + * of "console". You can use GetFileType() to see that
>>> + * handle and _get_osfhandle(fd) may have the same number
>>> + * value, but they refer to different actual files now.
>>
>> Certainly, the OS does not recycle handle values that are in use (open). Then
>> I do not quite get the point of this paragraph. See...
>>
>>> + *
>>> + * Note that dup2() when given target := {0,1,2} will also
>>> + * call SetStdHandle(), so we don't need to worry about that.
>>> + */
>>> + dup2(new_fd, fd);
>>> + if (console == handle)
>>> + console = duplicate;
>>
>> ... This is where "the cached value of console is updated", right? If console
>> == handle, then this is not because a handle value was recycled, but because
>> fd *was* console. Since the old value of console has been closed by the
>> dup2(), we must refer to the back-up value in the future. Am I missing
>> something?
>
> You are correct, we must update `console` because `handle` is no longer
> the handle we want.
>
> The comment above only meant to reinforce that we have to forget about the
> previous handle, too, as we might access something completely different
> than a console otherwise.
It is like accessing a pointer after free().
When I read the paragraph for the first time, I expected some
information to be saved, then some handles to be closed and re-opened,
which would possibly recycle a handle value, and then same state to be
resurrected depending on the information saved earlier.
But nothing of this kind happens, only:
dup2(new_fd, fd);
if (console == handle)
console = duplicate;
which is necessary and, once one has understood the context, obvious.
> Would you have a suggestion how to rephrase the comment to make it less
> confusing?
Perhaps
* This might close the cached console handle.
* We must cache the live duplicate instead.
Then update the cache before the dup2, because at this time all 3 of
console, handle, and duplicate are live and cannot be recycled:
if (console == handle)
console = duplicate;
dup2(new_fd, fd);
-- Hannes
^ permalink raw reply
* Re: [PATCH 4/2] t5615-alternate-env: double-quotes in file names do not work on Windows
From: Jeff King @ 2016-12-22 22:19 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Klaus Ethgen, git
In-Reply-To: <54ba9cff-b6f7-7660-261f-393cd5181da6@kdbg.org>
On Thu, Dec 22, 2016 at 08:06:02PM +0100, Johannes Sixt wrote:
> Am 22.12.2016 um 07:13 schrieb Johannes Sixt:
> > Am 21.12.2016 um 23:42 schrieb Jeff King:
> > > Hmph. I explicitly avoided a colon in the filename so that it would run
> > > on MINGW. Is a double-quote also not allowed?
> >
> > It is not allowed; that was my conclusion. But now that you ask, I'll
> > double-check.
>
> Ok, the point is that I get this error:
>
> mv: cannot move `one.git' to `"one.git'
>
> I don't feel inclined to find out which of 'mv' or the Windows API or the
> NTFS driver prevents the double-quotes and come up with a work-around just
> to get the test to run in some form. Let's leave it at the !MINGW
> prerequisite.
Thank you for double-checking (and sorry if my initial question was
confusing; I somehow missed the mention of dq in your subject line, and
just read the message body).
Your patch seems like the best solution.
-Peff
^ permalink raw reply
* What's cooking in git.git (Dec 2016, #07; Thu, 22)
From: Junio C Hamano @ 2016-12-22 22:18 UTC (permalink / raw)
To: git
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.
Even though I try not to do two "What's cooking" report back to back,
I wanted to push out a few topics that we want to have in 'master'
soonish on 'next' before things really quiet and slow down due to
year-end holidays.
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
Here are the summaries:
Will merge to 'master'.
+ jc/push-default-explicit 10-31/11-01 #2
+ sb/submodule-config-cleanup 11-22/11-23 #3
+ va/i18n-perl-scripts 12-14/12-19 #16
+ cp/merge-continue 12-15/12-19 #4
+ bw/transport-protocol-policy 12-15/12-19 #6
+ ls/filter-process 12-18/12-19 #2
+ ld/p4-compare-dir-vs-symlink 12-18/12-20 #1
+ jk/difftool-in-subdir 12-11/12-21 #4
+ sb/submodule-embed-gitdir 12-12/12-21 #6
+ gv/p4-multi-path-commit-fix 12-19/12-21 #1
+ mk/mingw-winansi-ttyname-termination-fix 12-20/12-21 #1
+ lt/shortlog-by-committer 12-20/12-21 #3
+ va/i18n-even-more 12-20/12-22 #1
+ ls/p4-lfs 12-20/12-22 #1
+ js/mingw-isatty 12-22/12-22 #3
+ bw/realpath-wo-chdir 12-22/12-22 #5
+ bw/grep-recurse-submodules 12-22/12-22 #7
Will merge to 'next'.
- jc/git-open-cloexec 11-02 #3
- ls/p4-path-encoding 12-18 #1
- mh/fast-import-notes-fix-new 12-20 #1
- jc/abbrev-autoscale-config 12-22 #1
- jc/retire-compaction-heuristics 12-22 #1
- nd/config-misc-fixes 12-22 #3
--------------------------------------------------
[Stalled]
* 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?
* nd/worktree-move (2016-11-28) 11 commits
. 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()
. copy.c: convert copy_file() to copy_dir_recursively()
. copy.c: style fix
. copy.c: convert bb_(p)error_msg to error(_errno)
. copy.c: delete unused code in copy_file()
. copy.c: import copy_file() from busybox
"git worktree" learned move and remove subcommands.
Reported to break builds on Windows.
* 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.
While I think it would make it easier for people to experiment and
build on if the topic is merged to 'next', I am at the same time a
bit reluctant to merge an unproven new topic that introduces a new
file format, which we may end up having to support til the end of
time. It is likely that to support a "prime clone from CDN", it
would need a lot more than just "these are the heads and the pack
data is over there", so this may not be sufficient.
Will discard.
* mh/connect (2016-06-06) 10 commits
- connect: [host:port] is legacy for ssh
- connect: move ssh command line preparation to a separate function
- connect: actively reject git:// urls with a user part
- connect: change the --diag-url output to separate user and host
- connect: make parse_connect_url() return the user part of the url as a separate value
- connect: group CONNECT_DIAG_URL handling code
- connect: make parse_connect_url() return separated host and port
- connect: re-derive a host:port string from the separate host and port variables
- connect: call get_host_and_port() earlier
- connect: document why we sometimes call get_port after get_host_and_port
Rewrite Git-URL parsing routine (hopefully) without changing any
behaviour.
It has been two months without any support. We may want to discard
this.
* ec/annotate-deleted (2015-11-20) 1 commit
- annotate: skip checking working tree if a revision is provided
Usability fix for annotate-specific "<file> <rev>" syntax with deleted
files.
Has been waiting for a review for too long without seeing anything.
Will discard.
* dk/gc-more-wo-pack (2016-01-13) 4 commits
- gc: clean garbage .bitmap files from pack dir
- t5304: ensure non-garbage files are not deleted
- t5304: test .bitmap garbage files
- prepare_packed_git(): find more garbage
Follow-on to dk/gc-idx-wo-pack topic, to clean up stale
.bitmap and .keep files.
Has been waiting for a reroll for too long.
cf. <xmqq60ypbeng.fsf@gitster.mtv.corp.google.com>
Will discard.
* 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]
* jc/abbrev-autoscale-config (2016-12-22) 1 commit
- config.abbrev: document the new default that auto-scales
Will merge to 'next'.
* jc/retire-compaction-heuristics (2016-12-22) 1 commit
- diff: retire the original experimental "compaction" heuristics
Will merge to 'next'.
* bw/push-submodule-only (2016-12-20) 3 commits
- push: add option to push only submodules
- submodules: add RECURSE_SUBMODULES_ONLY value
- transport: reformat flag #defines to be more readable
"git submodule push" learned "--recurse-submodules=only option to
push submodules out without pushing the top-level superproject.
* mk/mingw-winansi-ttyname-termination-fix (2016-12-20) 1 commit
(merged to 'next' on 2016-12-21 at 1e8e994605)
+ mingw: consider that UNICODE_STRING::Length counts bytes
A potential but unlikely buffer overflow in Windows port has been
fixed.
Will merge to 'master'.
* nd/config-misc-fixes (2016-12-22) 3 commits
- config.c: handle lock file in error case in git_config_rename_...
- config.c: rename label unlock_and_out
- config.c: handle error case for fstat() calls
Leakage of lockfiles in the config subsystem has been fixed.
Will merge to 'next'.
* va/i18n-even-more (2016-12-20) 1 commit
(merged to 'next' on 2016-12-22 at 209eee0530)
+ i18n: fix misconversion in shell scripts
Will merge to 'master'.
* gv/p4-multi-path-commit-fix (2016-12-19) 1 commit
(merged to 'next' on 2016-12-21 at f7ba714387)
+ git-p4: fix multi-path changelist empty commits
"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.
Will merge to 'master'.
* js/mingw-isatty (2016-12-22) 3 commits
(merged to 'next' on 2016-12-22 at 5be6c1a083)
+ mingw: replace isatty() hack
+ mingw: fix colourization on Cygwin pseudo terminals
+ mingw: adjust is_console() to work with stdin
Update the isatty() emulation for Windows by updating the previous
hack that depended on internals of (older) MSVC runtime.
Will merge to 'master'.
* ls/p4-lfs (2016-12-20) 1 commit
(merged to 'next' on 2016-12-22 at 0759f94c65)
+ git-p4: add diff/merge properties to .gitattributes for GitLFS files
Update GitLFS integration with "git p4".
Will merge to 'master'.
* ls/p4-path-encoding (2016-12-18) 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.
Will merge to 'next'.
* mh/fast-import-notes-fix-new (2016-12-20) 1 commit
- fast-import: properly fanout notes when tree is imported
"git fast-import" sometimes mishandled while rebalancing notes
tree, which has been fixed.
Will merge to 'next'.
* bw/pathspec-cleanup (2016-12-14) 16 commits
- pathspec: rename prefix_pathspec to init_pathspec_item
- pathspec: small readability changes
- pathspec: create strip submodule slash helpers
- pathspec: create parse_element_magic helper
- pathspec: create parse_long_magic function
- pathspec: create parse_short_magic function
- pathspec: factor global magic into its own function
- pathspec: simpler logic to prefix original pathspec elements
- pathspec: always show mnemonic and name in unsupported_magic
- pathspec: remove unused variable from unsupported_magic
- pathspec: copy and free owned memory
- pathspec: remove the deprecated get_pathspec function
- ls-tree: convert show_recursive to use the pathspec struct interface
- dir: convert fill_directory to use the pathspec struct interface
- dir: remove struct path_simplify
- mv: remove use of deprecated 'get_pathspec()'
Code clean-up in the pathspec API.
Waiting for the (hopefully) final round of review before 'next'.
* cp/merge-continue (2016-12-15) 4 commits
(merged to 'next' on 2016-12-19 at 8ba0094f45)
+ merge: mark usage error strings for translation
+ merge: ensure '--abort' option takes no arguments
+ completion: add --continue option for merge
+ merge: add '--continue' option as a synonym for 'git commit'
"git merge --continue" has been added as a synonym to "git commit"
to conclude a merge that has stopped due to conflicts.
Will merge to 'master'.
* ld/p4-compare-dir-vs-symlink (2016-12-18) 1 commit
(merged to 'next' on 2016-12-20 at f58fed9ef8)
+ git-p4: avoid crash adding symlinked directory
"git p4" misbehaved when swapping a directory and a symbolic link.
Will merge to 'master'.
* js/prepare-sequencer-more (2016-12-14) 34 commits
- sequencer (rebase -i): write out the final message
- sequencer (rebase -i): write the progress into files
- sequencer (rebase -i): show the progress
- sequencer (rebase -i): suggest --edit-todo upon unknown command
- sequencer (rebase -i): show only failed cherry-picks' output
- sequencer (rebase -i): show only failed `git commit`'s output
- run_command_opt(): optionally hide stderr when the command succeeds
- sequencer (rebase -i): differentiate between comments and 'noop'
- sequencer (rebase -i): implement the 'drop' command
- sequencer (rebase -i): allow rescheduling commands
- sequencer (rebase -i): respect strategy/strategy_opts settings
- sequencer (rebase -i): respect the rebase.autostash setting
- sequencer (rebase -i): run the post-rewrite hook, if needed
- sequencer (rebase -i): record interrupted commits in rewritten, too
- sequencer (rebase -i): copy commit notes at end
- sequencer (rebase -i): set the reflog message consistently
- sequencer (rebase -i): refactor setting the reflog message
- sequencer (rebase -i): allow fast-forwarding for edit/reword
- sequencer (rebase -i): implement the 'reword' command
- sequencer (rebase -i): leave a patch upon error
- sequencer (rebase -i): update refs after a successful rebase
- sequencer (rebase -i): the todo can be empty when continuing
- sequencer (rebase -i): skip some revert/cherry-pick specific code path
- sequencer (rebase -i): remove CHERRY_PICK_HEAD when no longer needed
- sequencer (rebase -i): allow continuing with staged changes
- sequencer (rebase -i): write an author-script file
- sequencer (rebase -i): implement the short commands
- sequencer (rebase -i): add support for the 'fixup' and 'squash' commands
- sequencer (rebase -i): write the 'done' file
- sequencer (rebase -i): learn about the 'verbose' mode
- sequencer (rebase -i): implement the 'exec' command
- sequencer (rebase -i): implement the 'edit' command
- sequencer (rebase -i): implement the 'noop' command
- sequencer: support a new action: 'interactive rebase'
The sequencer has further been extended in preparation to act as a
back-end for "rebase -i".
Waiting for review to conclude.
* lt/shortlog-by-committer (2016-12-20) 3 commits
(merged to 'next' on 2016-12-21 at c72e6e7f76)
+ t4201: make tests work with and without the MINGW prerequiste
(merged to 'next' on 2016-12-19 at 555976fc0a)
+ shortlog: test and document --committer option
+ shortlog: group by committer information
"git shortlog" learned "--committer" option to group commits by
committer, instead of author.
Will merge to 'master'.
* bw/realpath-wo-chdir (2016-12-22) 5 commits
(merged to 'next' on 2016-12-22 at fea8fa870f)
+ real_path: canonicalize directory separators in root parts
+ real_path: have callers use real_pathdup and strbuf_realpath
+ real_path: create real_pathdup
+ real_path: convert real_path_internal to strbuf_realpath
+ real_path: resolve symlinks by hand
(this branch is used by bw/grep-recurse-submodules.)
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.
Will merge to 'master'.
* jk/difftool-in-subdir (2016-12-11) 4 commits
(merged to 'next' on 2016-12-21 at c1056e014b)
+ difftool: rename variables for consistency
+ difftool: chdir as early as possible
+ difftool: sanitize $workdir as early as possible
+ difftool: fix dir-diff index creation when in a subdirectory
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.
Will merge to 'master'.
* ls/filter-process (2016-12-18) 2 commits
(merged to 'next' on 2016-12-19 at 5ed29656db)
+ t0021: fix flaky test
(merged to 'next' on 2016-12-12 at 8ed1f9eb02)
+ docs: warn about possible '=' in clean/smudge filter process values
Doc update.
Will merge to 'master'.
* js/difftool-builtin (2016-11-28) 2 commits
- difftool: implement the functionality in the builtin
- difftool: add a skeleton for the upcoming builtin
Rewrite a scripted porcelain "git difftool" in C.
What's the doneness of this topic?
* sb/push-make-submodule-check-the-default (2016-11-29) 2 commits
(merged to 'next' on 2016-12-12 at 1863e05af5)
+ push: change submodule default to check when submodules exist
+ submodule add: extend force flag to add existing repos
Turn the default of "push.recurseSubmodules" to "check" when
submodules seem to be in use.
Will cook in 'next'.
* sb/submodule-embed-gitdir (2016-12-12) 6 commits
(merged to 'next' on 2016-12-21 at e6cdbcf013)
+ submodule: add absorb-git-dir function
+ move connect_work_tree_and_git_dir to dir.h
+ worktree: check if a submodule uses worktrees
+ test-lib-functions.sh: teach test_commit -C <dir>
+ submodule helper: support super prefix
+ submodule: use absolute path for computing relative path connecting
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.
Will merge to 'master'.
* bw/grep-recurse-submodules (2016-12-22) 7 commits
(merged to 'next' on 2016-12-22 at 1ede815b8d)
+ grep: search history of moved submodules
+ grep: enable recurse-submodules to work on <tree> objects
+ grep: optionally recurse into submodules
+ grep: add submodules as a grep source type
+ submodules: load gitmodules file from commit sha1
+ submodules: add helper to determine if a submodule is initialized
+ submodules: add helper to determine if a submodule is populated
(this branch uses bw/realpath-wo-chdir.)
"git grep" learns to optionally recurse into submodules.
Will merge to 'master'.
* dt/smart-http-detect-server-going-away (2016-11-18) 2 commits
(merged to 'next' on 2016-12-05 at 3ea70d01af)
+ upload-pack: optionally allow fetching any sha1
+ remote-curl: don't hang when a server dies before any output
Originally merged to 'next' on 2016-11-21
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.
An improvement counterproposal has failed.
cf. <20161114194049.mktpsvgdhex2f4zv@sigill.intra.peff.net>
Will cook in 'next'.
* mm/push-social-engineering-attack-doc (2016-11-14) 1 commit
(merged to 'next' on 2016-12-05 at 9a2b5bd1a9)
+ doc: mention transfer data leaks in more places
Originally merged to 'next' on 2016-11-16
Doc update on fetching and pushing.
Will cook in 'next'.
* jc/compression-config (2016-11-15) 1 commit
(merged to 'next' on 2016-12-05 at 323769ca07)
+ compression: unify pack.compression configuration parsing
Originally merged to 'next' on 2016-11-23
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.
Will cook in 'next'.
* mm/gc-safety-doc (2016-11-16) 1 commit
(merged to 'next' on 2016-12-05 at 031ecc1886)
+ git-gc.txt: expand discussion of races with other processes
Originally merged to 'next' on 2016-11-17
Doc update.
Will cook in 'next'.
* kn/ref-filter-branch-list (2016-12-08) 20 commits
- 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: 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
- for-each-ref: do not segv with %(HEAD) on an unborn branch
The code to list branches in "git branch" has been consolidated
with the more generic ref-filter API.
Waiting for a reroll.
cf. <CAOLa=ZREUWqdH_2HNn_JQcf4RW9k1dAN5BtwPN2HnzuDoUdkWw@mail.gmail.com>
* bw/transport-protocol-policy (2016-12-15) 6 commits
(merged to 'next' on 2016-12-19 at 166168205c)
+ http: respect protocol.*.allow=user for http-alternates
+ transport: add from_user parameter to is_transport_allowed
+ http: create function to get curl allowed protocols
+ transport: add protocol policy config option
+ http: always warn if libcurl version is too old
+ lib-proto-disable: variable name fix
Finer-grained control of what protocols are allowed for transports
during clone/fetch/push have been enabled via a new configuration
mechanism.
Will merge to 'master'.
* jt/fetch-no-redundant-tag-fetch-map (2016-11-11) 1 commit
(merged to 'next' on 2016-12-05 at 432f9469a7)
+ fetch: do not redundantly calculate tag refmap
Originally merged to 'next' on 2016-11-16
Code cleanup to avoid using redundant refspecs while fetching with
the --tags option.
Will cook in 'next'.
* sb/submodule-config-cleanup (2016-11-22) 3 commits
(merged to 'next' on 2016-12-05 at 658b8764bf)
+ submodule-config: clarify parsing of null_sha1 element
+ submodule-config: rename commit_sha1 to treeish_name
+ submodule config: inline config_from_{name, path}
Originally merged to 'next' on 2016-11-23
Minor code clean-up.
Will merge to 'master'.
* jc/push-default-explicit (2016-10-31) 2 commits
(merged to 'next' on 2016-12-05 at d63f3777af)
+ push: test pushing ambiguously named branches
+ push: do not use potentially ambiguous default refspec
Originally merged to 'next' on 2016-11-01
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.
Will merge to 'master'.
* jc/git-open-cloexec (2016-11-02) 3 commits
- sha1_file: stop opening files with O_NOATIME
- git_open_cloexec(): use fcntl(2) w/ FD_CLOEXEC fallback
- git_open(): untangle possible NOATIME and CLOEXEC interactions
The codeflow of setting NOATIME and CLOEXEC on file descriptors Git
opens has been simplified.
Will merge to 'next'.
We may want to drop the tip one, but we'll see.
* 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/reset-unmerge (2016-10-24) 1 commit
- reset: --unmerge
After "git add" is run prematurely during a conflict resolution,
"git diff" can no longer be used as a way to sanity check by
looking at the combined diff. "git reset" learned a new
"--unmerge" option to recover from this situation.
Will discard.
This may not be needed, given that update-index has a similar
option.
* jc/merge-base-fp-only (2016-10-19) 8 commits
. merge-base: fp experiment
- merge: allow to use only the fp-only merge bases
- merge-base: limit the output to bases that are on first-parent chain
- merge-base: mark bases that are on first-parent chain
- merge-base: expose get_merge_bases_many_0() a bit more
- merge-base: stop moving commits around in remove_redundant()
- sha1_name: remove ONELINE_SEEN bit
- commit: simplify fastpath of merge-base
An experiment of merge-base that ignores common ancestors that are
not on the first parent chain.
Will discard.
The whole premise feels wrong.
* tb/convert-stream-check (2016-10-27) 2 commits
- convert.c: stream and fast search for binary
- read-cache: factor out get_sha1_from_index() helper
End-of-line conversion sometimes needs to see if the current blob
in the index has NULs and CRs to base its decision. We used to
always get a full statistics over the blob, but in many cases we
can return early when we have seen "enough" (e.g. if we see a
single NUL, the blob will be handled as binary). The codepaths
have been optimized by using streaming interface.
Will discard.
Retracted.
cf. <20161102071646.GA5094@tb-raspi>
* 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.
Waiting for review to conclude.
* st/verify-tag (2016-10-10) 7 commits
- t/t7004-tag: Add --format specifier tests
- t/t7030-verify-tag: Add --format specifier tests
- builtin/tag: add --format argument for tag -v
- builtin/verify-tag: add --format to verify-tag
- tag: add format specifier to gpg_verify_tag
- ref-filter: add function to print single ref_array_item
- gpg-interface, tag: add GPG_VERIFY_QUIET flag
"git tag" and "git verify-tag" learned to put GPG verification
status in their "--format=<placeholders>" output format.
Waiting for a reroll.
cf. <20161007210721.20437-1-santiago@nyu.edu>
* sb/attr (2016-11-11) 35 commits
. completion: clone can initialize specific submodules
. clone: add --init-submodule=<pathspec> switch
. submodule update: add `--init-default-path` switch
. pathspec: allow escaped query values
. pathspec: allow querying for attributes
. pathspec: move prefix check out of the inner loop
. pathspec: move long magic parsing out of prefix_pathspec
- Documentation: fix a typo
- attr: keep attr stack for each check
- attr: convert to new threadsafe API
- attr: make git_check_attr_counted static
- attr.c: outline the future plans by heavily commenting
- attr.c: always pass check[] to collect_some_attrs()
- attr.c: introduce empty_attr_check_elems()
- attr.c: correct ugly hack for git_all_attrs()
- attr.c: rename a local variable check
- attr.c: pass struct git_attr_check down the callchain
- attr.c: add push_stack() helper
- attr: support quoting pathname patterns in C style
- attr: expose validity check for attribute names
- attr: add counted string version of git_check_attr()
- 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 git_attr_check"
- attr: (re)introduce git_check_attr() and struct git_attr_check
- attr: rename function and struct related to checking attributes
- 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 attributes API has been updated so that it can later be
optimized using the knowledge of which attributes are queried.
Building on top of the updated API, the pathspec machinery learned
to select only paths with given attributes set.
The parts near the tip about pathspec would need to work better
with bw/pathspec-cleanup topic and has been dropped for now.
* va/i18n-perl-scripts (2016-12-14) 16 commits
(merged to 'next' on 2016-12-19 at ec800aba9f)
+ i18n: difftool: mark warnings for translation
+ i18n: send-email: mark composing message for translation
+ i18n: send-email: mark string with interpolation for translation
+ i18n: send-email: mark warnings and errors for translation
+ i18n: send-email: mark strings for translation
+ i18n: add--interactive: mark status words for translation
+ i18n: add--interactive: remove %patch_modes entries
+ i18n: add--interactive: mark edit_hunk_manually message for translation
+ i18n: add--interactive: i18n of help_patch_cmd
+ i18n: add--interactive: mark patch prompt for translation
+ i18n: add--interactive: mark plural strings
+ i18n: clean.c: match string with git-add--interactive.perl
+ i18n: add--interactive: mark strings with interpolation for translation
+ i18n: add--interactive: mark simple here-documents for translation
+ i18n: add--interactive: mark strings for translation
+ Git.pm: add subroutines for commenting lines
Porcelain scripts written in Perl are getting internationalized.
Will merge to 'master'.
* jc/latin-1 (2016-09-26) 2 commits
(merged to 'next' on 2016-12-05 at fb549caa12)
+ utf8: accept "latin-1" as ISO-8859-1
+ utf8: refactor code to decide fallback encoding
Originally merged to 'next' on 2016-09-28
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.
Will cook in 'next'.
* sg/fix-versioncmp-with-common-suffix (2016-12-08) 8 commits
- versioncmp: generalize version sort suffix reordering
- squash! versioncmp: use earliest-longest contained suffix to determine sorting order
- versioncmp: use earliest-longest contained suffix to determine sorting order
- versioncmp: cope with common part overlapping with prerelease suffix
- versioncmp: pass full tagnames to swap_prereleases()
- t7004-tag: add version sort tests to show prerelease reordering issues
- t7004-tag: use test_config helper
- t7004-tag: delete unnecessary tags with test_when_finished
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).
Waiting for review to conclude.
cf. <20161208142401.1329-1-szeder.dev@gmail.com>
* 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'.
^ permalink raw reply
* Re: [RFC/PATCH] add diffstat information to rebase
From: Stefan Beller @ 2016-12-22 22:13 UTC (permalink / raw)
To: git, Johannes.Schindelin; +Cc: Stefan Beller
In-Reply-To: <alpine.DEB.2.20.1612222239390.155951@virtualbox>
On Thu, Dec 22, 2016 at 1:41 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi Stefan,
>
> On Thu, 22 Dec 2016, Stefan Beller wrote:
>
>> This is a small hack that adds the diffstat to the interactive rebase
>> helping me a bit during the rebase, such that:
>>
>> $ git rebase -i HEAD^^
>>
>> pick 2eaa3f532c Third batch for 2.12
>> # Documentation/RelNotes/2.12.0.txt | 40 +++++++++++++++++++++++++++++++++++++++
>> # 1 file changed, 40 insertions(+)
>> pick 3170a3a57b add information to rebase
>> # git-rebase--interactive.sh | 2 ++
>> # 1 file changed, 2 insertions(+)
>
> If it helps you, fine. But please make it opt-in. I would hate to see it
> in all my rebases, I find that information more confusing than helpful.
That's what I realized now that I played around with it for a day, because it actually
creates more lines than I can fit into my terminal in one screen now.
*Ideally* I would rather have a different formatting, e.g. maybe:
$ git checkout remotes/origin/js/sequencer-wo-die
$ git rebase -i --new-magic v2.10.0-rc2^
which produces:
pick d5cb9cbd64 Git 2.10-rc2 | Documentation/RelNo.., GIT-VERSION-GEN -..(+5, -1)
...
pick dbfad033d4 sequencer: do not die() in do_pick_commit() | sequencer.c - do_pick_commit (+7, -6)
pick 4ef3d8f033 sequencer: lib'ify write_message() | sequencer.c - write_message, do_pick_com..(+11, -9)
...
...
pick 88d5a271b0 sequencer: lib'ify save_opts() | sequencer.c - save_opts + sequencer_pick..(+20, -20)
pick 0e408fc347 sequencer: lib'ify fast_forward_to() | sequencer.c - fast_forward_to (+1, -1)
pick 55f5704da6 sequencer: lib'ify checkout_fast_forward() | sequencer.c - checkout_fast_forward (+6, -3)
pick 49fb937e9a sequencer: ensure to release the lock when w... | sequencer.c - read_and_refresh_cache (+6, -3)
When writing this example, I do notice that some sorts of commits put
nearly this exact information into the commit message. But that happens
when the commit is already well crafted and often it is refactoring.
A good example for the use case of this new format would be
origin/js/regexec-buf as there the commit message doesn't give
away what files and functions are touched.
Another very good example for the usefulness of the new format
appears to be origin/js/am-3-merge-recursive-direct, because:
* there are quite a few commits in the series.
(This feature seems to only be useful for long reshuffling series'
for interactive rebase in my mind.)
* It is not obvious by the commit title, which parts of the code
are touched. (files, functions)
* With a longer series, you can produce different valid orders for the
patches to be applied, e.g. compiling and testing works even if the patches
were applied in different orders.
Well actually the best use case are unfinished series,
with lots of "fixup" commits. :)
>
>> git-rebase--interactive.sh | 2 ++
>> 1 file changed, 2 insertions(+)
>
> Oh well. I guess I have to modify sequencer-i yet another time.
I think this feature can wait until the sequencer is in
and then we can build it on top, time permitting.
Thanks,
Stefan
^ permalink raw reply
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