git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
	"Galan Rémi" <remi.galan-alfonso@ensimag.grenoble-inp.fr>
Subject: Re: [PATCH] rebase: accept indented comments (fixes regression)
Date: Wed, 30 Sep 2015 21:17:02 +0200	[thread overview]
Message-ID: <vpqwpv7hg41.fsf@grenoble-inp.fr> (raw)
In-Reply-To: <xmqqd1wz9402.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Wed, 30 Sep 2015 11:05:49 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> With Git <2.0.6, 'git rebase' used to accept lines starting with
>> whitespaces followed with '#' as a comment. This was broken by
>> 804098b (git rebase -i: add static check for commands and SHA-1,
>> 2015-06-29), which introduced additional checks on the TODO-list using
>> "git stripspaces" which only strips comments starting at the first
>> column.
>
> I cannot help thinking that this is sidestepping the real issue.
>
> The real issue, I think, is that the new check tokenises the input
> differently from how the expand_todo_ids -> transform_todo_ids
> callchain parses it.  The problem Nazri Ramliy noticed about the new
> check that does not ignore the indentation is merely one aspect of
> it.

Right.

> Stripping leading whilespaces with sed may ignore indented anything
> and help Nazri's script, but 804098b tightened checks to disallow
> other things that we historically allowed, e.g. if you replace SP
> between "pick" and the commit object name with an HT, the new check
> will not notice that HT is also a perfectly good token separator
> character and barfs.

Indeed. I'm adding a test for that too.

> I am actually tempted to say that we should revert 804098b, which is
> the simplest fix.

I think the commit has value, and reverting it makes the "drop" command
essentially useless.

> As far as I can tell, the hand-rolled parsing is there only in oder
> to report the incoming $line as-is.

Indeed, I remember finding the parsing code weird when I reviewed it,
and the reason was to provide the exact line.

> It is much easier to just identify with which line number the location
> of the problem, and show it when it is necessary from the original
> source, and we do not care about performance in the error codepath.

Agreed.

> Perhaps something along these lines instead, with your new tests
> added in?

Sounds good, yes. I'll send a patch with this and my updated tests.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2015-09-30 19:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30  8:11 [PATCH] rebase: accept indented comments (fixes regression) Matthieu Moy
2015-09-30  9:58 ` Remi Galan Alfonso
2015-09-30 18:05 ` Junio C Hamano
2015-09-30 19:17   ` Matthieu Moy [this message]
2015-09-30 19:31     ` Junio C Hamano
2015-09-30 19:18   ` Junio C Hamano
2015-09-30 19:50     ` Matthieu Moy
2015-09-30 20:34       ` Junio C Hamano
2015-10-01  8:18         ` [PATCH v3 1/2] rebase-i: explicitly accept tab as separator in commands Matthieu Moy
2015-10-01  8:18           ` [PATCH v3 2/2] rebase-i: loosen over-eager check_bad_cmd check Matthieu Moy
2015-09-30 20:01     ` [PATCH] " Matthieu Moy
2015-09-30 20:04       ` Eric Sunshine
2015-09-30 20:10         ` [PATCH v2] " Matthieu Moy

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=vpqwpv7hg41.fsf@grenoble-inp.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=remi.galan-alfonso@ensimag.grenoble-inp.fr \
    /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).