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

Re: git-rebase -i not escaping # at the beginning of the line

From
Petr Baudis <pasky@suse.cz>
Date
Jun 3, 2009, 10:57 UTC
Message-ID
<20090603105703.GB10035@machine.or.cz>
In-Reply-To
<alpine.DEB.1.00.0906031252070.10241@intel-tinevez-2-302>
  Hi,
On Wed, Jun 03, 2009 at 12:53:27PM +0200, Johannes Schindelin wrote:
Show 19 quoted lines
> On Wed, 3 Jun 2009, Petr Baudis wrote:
> 
> > On Tue, Jun 02, 2009 at 12:28:41PM -0700, donnoman wrote:
> > > Redmine automatically links those log messages to the ticket when we
> > > use this method.  It works well for git commit -m "#1234 story xyz"
> > > 
> > > However, when we use git rebase -i, all of the lines that include the
> > > # character get stripped out of the commit messages.
> > > 
> > > How can we escape these?
> > 
> > This definitely sounds like a bug, what git version are you using?
> 
> It is sort of a bug, in a very peculiar: try amending such a commit 
> _interactively_.  It will not work.
> 
> The reason: you are not supposed to start any line in a commit message 
> with a '#'.  I would actually have expected "git commit -m" to refuse such 
> a line.
  the line can also come there during import from another VCS, through
email, or so... I think it's more reasonable to deal with them when
filling in the commit message to the editor than in all the other
places.
-- 
				Petr "Pasky" Baudis
The lyf so short, the craft so long to lerne. -- Chaucer
Previous: Johannes SchindelinNext: Alberto Leal
Message 3 of 4 in “git-rebase -i not escaping # at the beginning of the line”
  1. Petr BaudisJun 3, 2009
  2. Johannes SchindelinJun 3, 2009
  3. Petr BaudisJun 3, 2009
  4. Alberto LealJun 3, 2009

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.