git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>,
	Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, "Ralf Thielow" <ralf.thielow@gmail.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Taufiq Hoven" <taufiq.hoven@gmail.com>
Subject: Re: [PATCH 1/3] rebase -i: identify problems with core.commentchar
Date: Mon, 21 Nov 2016 10:15:43 -0800	[thread overview]
Message-ID: <xmqqbmx8k8c0.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <f47dce15719954d6d4d8a550856757366871143e.1479737858.git.johannes.schindelin@gmx.de> (Johannes Schindelin's message of "Mon, 21 Nov 2016 15:18:05 +0100 (CET)")

Johannes Schindelin <johannes.schindelin@gmx.de> writes:

> diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh
> index 29e91d8..202ac07 100755
> --- a/t/t0030-stripspace.sh
> +++ b/t/t0030-stripspace.sh
> @@ -432,6 +432,13 @@ test_expect_success '-c with changed comment char' '
>  	test_cmp expect actual
>  '
>  
> +test_expect_failure '-c with comment char defined in .git/config' '
> +	test_config core.commentchar = &&
> +	printf "= foo\n" >expect &&
> +	printf "foo" | git stripspace -c >actual &&

We'd want "\n" on this printf to match the one before as well, as
this test is not about "does stripspace complete an incomplete
line?", I think.  

I could amend it while queuing, but I need to know if I am missing a
reason why this must be an incomplete line before doing so.

> +	test_cmp expect actual
> +'
> +

Is this a recent regression?  When applied on top of 'maint' or
older, it seems to pass just fine.

    ... Goes and looks ...

Interesting.  Peff's b9605bc4f2 ("config: only read .git/config from
configured repos", 2016-09-12) is where this starts failing, which
is understandable given the code change to builtin/stripspace.c in
[2/3].  

The analysis of the log message in [2/3] is wrong and needs
updating, though.  In the old world order it worked by accident to
call git_config() without calling setup_git_directory(); after
b9605bc4f2, that no longer is valid and is exposed as a bug.  

Your [2/3] is a good fix for that change.

In any case, well spotted.

>  test_expect_success 'avoid SP-HT sequence in commented line' '
>  	printf "#\tone\n#\n# two\n" >expect &&
>  	printf "\tone\n\ntwo\n" | git stripspace -c >actual &&
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index e38e296..e080399 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -976,6 +976,18 @@ test_expect_success 'rebase -i respects core.commentchar' '
>  	test B = $(git cat-file commit HEAD^ | sed -ne \$p)
>  '
>  
> +test_expect_failure 'rebase -i respects core.commentchar=auto' '
> +	test_config core.commentchar auto &&
> +	write_script copy-edit-script.sh <<-\EOF &&
> +	cp "$1" edit-script
> +	EOF
> +	test_set_editor "$(pwd)/copy-edit-script.sh" &&
> +	test_when_finished "git rebase --abort || :" &&
> +	git rebase -i HEAD^ &&
> +	grep "^#" edit-script &&

This was added for debugging that was forgotten?

> +	test -z "$(grep -ve "^#" -e "^\$" -e "^pick" edit-script)"

This says "There shouldn't be any line left once we remove
'#'-commented lines, empty lines and pick insns.".  OK.

The correction in [3/3] seems good.

> +'
> +
>  test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
>  	test_when_finished "git branch -D torebase" &&
>  	git checkout -b torebase branch1 &&

  reply	other threads:[~2016-11-21 18:15 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 14:18 [PATCH 0/3] Fix problems with rebase -i when core.commentchar is defined Johannes Schindelin
2016-11-21 14:18 ` [PATCH 1/3] rebase -i: identify problems with core.commentchar Johannes Schindelin
2016-11-21 18:15   ` Junio C Hamano [this message]
2016-11-21 18:24     ` Junio C Hamano
2016-11-21 19:05       ` [PATCH 1/3] rebase -i: highlight " Junio C Hamano
2016-11-21 19:05         ` [PATCH 2/3] stripspace: respect repository config Junio C Hamano
2016-11-21 20:28           ` Junio C Hamano
2016-11-22 16:11           ` Johannes Schindelin
2016-11-21 19:05         ` [PATCH 3/3] rebase -i: handle core.commentChar=auto Junio C Hamano
2016-11-21 20:29           ` Junio C Hamano
2016-11-21 20:25         ` [PATCH 1/3] rebase -i: highlight problems with core.commentchar Junio C Hamano
2016-11-22 16:09         ` Johannes Schindelin
2016-11-22 17:05           ` Junio C Hamano
2016-11-23 11:05             ` Johannes Schindelin
2016-11-21 18:49     ` [PATCH 1/3] rebase -i: identify " Jeff King
2016-11-21 19:12       ` Junio C Hamano
2016-11-21 23:38         ` Jeff King
2016-11-22 16:09     ` Johannes Schindelin
2016-11-21 14:18 ` [PATCH 2/3] stripspace: respect repository config Johannes Schindelin
2016-11-22 10:10   ` Duy Nguyen
2016-11-22 16:13     ` Johannes Schindelin
2016-11-22 17:10       ` Junio C Hamano
2016-11-22 19:10         ` Junio C Hamano
2016-11-22 19:50           ` Jeff King
2016-11-22 20:24             ` Junio C Hamano
2016-11-22 21:19               ` Jeff King
2016-11-22 21:22                 ` Junio C Hamano
2016-11-22 21:43                   ` Jeff King
2016-11-22 21:55                     ` Junio C Hamano
2016-11-23  0:12                       ` Jeff King
2016-11-22 21:24                 ` Jeff King
2016-11-21 14:18 ` [PATCH 3/3] rebase -i: handle core.commentChar=auto Johannes Schindelin
2016-11-21 18:26   ` Johannes Sixt
2016-11-21 18:40     ` Junio C Hamano
2016-11-21 18:58       ` Johannes Sixt
2016-11-21 19:07         ` Junio C Hamano
2016-11-21 19:14           ` Johannes Sixt
2016-11-22 16:04     ` Johannes Schindelin
2016-11-22 10:31   ` Duy Nguyen
2016-11-21 16:58 ` [PATCH 0/3] Fix problems with rebase -i when core.commentchar is defined Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqbmx8k8c0.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=ralf.thielow@gmail.com \
    --cc=taufiq.hoven@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).