git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] t3430: update to test with custom commentChar

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 10, 2018, 13:08 UTC
Message-ID
<nycvar.QRO.7.76.6.1807101504530.75@tvgsbejvaqbjf.bet>
In-Reply-To
<aa716d3f-6a80-e3fc-0172-1027fb85c792@living180.net>
Hi Daniel,
On Tue, 10 Jul 2018, Daniel Harding wrote:
Show 47 quoted lines
> On Mon, 09 Jul 2018 at 22:14:58 +0300, Johannes Schindelin wrote:
> > 
> > On Mon, 9 Jul 2018, Daniel Harding wrote:
> > > 
> > > On Mon, 09 Jul 2018 at 00:02:00 +0300, brian m. carlson wrote:
> > > >
> > > > Should this affect the "# Merge the topic branch" line (and the "# C",
> > > > "# E", and "# H" lines in the next test) that appears below this?  It
> > > > would seem those would qualify as comments as well.
> > >
> > > I intentionally did not change that behavior for two reasons:
> > >
> > > a) from a Git perspective, comment characters are only effectual for
> > > comments
> > > if they are the first character in a line
> > >
> > > and
> > >
> > > b) there are places where a '#' character from the todo list is actually
> > > parsed and used e.g. [0] and [1].  I have not yet gotten to the point of
> > > grokking what is going on there, so I didn't want to risk breaking
> > > something I
> > > didn't understand.  Perhaps Johannes could shed some light on whether the
> > > cases you mentioned should be changed to use the configured commentChar or
> > > not.
> > >
> > > [0]
> > > https://github.com/git/git/blob/53f9a3e157dbbc901a02ac2c73346d375e24978c/sequencer.c#L2869
> > > [1]
> > > https://github.com/git/git/blob/53f9a3e157dbbc901a02ac2c73346d375e24978c/sequencer.c#L3797
> > 
> > These are related. The first one tries to support
> > 
> >  merge -C cafecafe second-branch third-branch # Octopus 2nd/3rd branch
> > 
> > i.e. use '#' to separate between the commit(s) to merge and the oneline
> > (the latter for the reader's pleasure, just like the onelines in the `pick
> > <hash> <oneline>` lines.
> > 
> > The second ensures that there is no valid label `#`.
> > 
> > I have not really thought about the ramifications of changing this to
> > comment_line_char, but I guess it *could* work if both locations were
> > changed.
> 
> Is there interest in such a change?  I'm happy to take a stab at it if there
> is, otherwise I'll leave things as they are.

I think it would be a fine change, once we convinced ourselves that it does not break things (I am a little worried about this because I remember just how long I had to reflect about the ramifications with regards to the label: `#` is a valid ref name, after all, and that was the reason why I had to treat it specially, and I wonder whether allowing arbitrary comment chars will require us to add more such special handling that is not necessary if we stick to `#`).

Not that the comment line char feature seems to be all that safe. I could imagine that setting it to ' ' (i.e. a single space) wreaks havoc with Git, and we have no safeguard to error out in this obviously broken case.

Ciao, Dscho

Previous: Daniel HardingNext: Daniel Harding
Message 13 of 24 in “Fix --rebase-merges with custom commentChar”
  1. 0/2 Fix --rebase-merges with custom commentCharDaniel Harding, Jul 8, 2018
  2. 1/2 sequencer: fix --rebase-merges with custom commentCharDaniel Harding, Jul 8, 2018
  3. 2/2 t3430: update to test with custom commentCharDaniel Harding, Jul 8, 2018
  4. brian m. carlsonJul 8, 2018
  5. Johannes SchindelinJul 9, 2018
  6. Junio C HamanoJul 9, 2018
  7. Daniel HardingJul 9, 2018
  8. Johannes SchindelinJul 9, 2018
  9. Junio C HamanoJul 9, 2018
  10. Daniel HardingJul 9, 2018
  11. Johannes SchindelinJul 9, 2018
  12. Daniel HardingJul 10, 2018
  13. Johannes SchindelinJul 10, 2018
  14. Daniel HardingJul 10, 2018
  15. Johannes SchindelinOct 2, 2018
  16. brian m. carlsonJul 9, 2018
  17. Johannes SchindelinJul 9, 2018
  18. Daniel HardingJul 10, 2018
  19. Aaron SchrabJul 12, 2018
  20. Junio C HamanoJul 12, 2018
  21. sequencer: use configured comment characterAaron Schrab, Jul 16, 2018
  22. Johannes SchindelinJul 16, 2018
  23. Daniel HardingJul 16, 2018
  24. Johannes SchindelinJul 17, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.