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

Re: [PATCH 1/2] git-svn: don't append extra newlines at the end of commit messages.

From
Andreas Ericsson <ae@op5.se>
Date
Jun 13, 2008, 07:23 UTC
Message-ID
<48522055.6060006@op5.se>
In-Reply-To
<1213312251-8081-1-git-send-email-apenwarr@gmail.com>
Avery Pennarun wrote:
Show 13 quoted lines
> In git, all commits end in exactly one newline character.  In svn, commits
> end in zero or more newlines.  Thus, when importing commits from svn into
> git, git-svn always appends two extra newlines to ensure that the
> git-svn-id: line is separated from the main commit message by at least one
> blank line.
> 
> Combined with the terminating newline that's always present in svn commits
> produced by git, you usually end up with two blank lines instead of one
> between the commit message and git-svn-id: line, which is undesirable.
> 
> Instead, let's remove all trailing whitespace from the git commit on the way
> through to svn.
> 

I'm not familiar with git-svn, and my perl is pretty weak as it is. Are you proposing to remove extra whitespace from git commits when they are sent back to svn via dcommit? If so, wouldn't it be better to always strip extra newlines when importing from svn so they're never there in the first place?

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Avery PennarunNext: Karl Hasselström
Message 6 of 9 in “git-svn: don't append extra newlines at the end of commit messages.”
  1. 1/2 git-svn: don't append extra newlines at the end of commit messages.Avery Pennarun, Jun 12, 2008
  2. 2/2 git-svn: test that extra blank lines aren't inserted in commit messages.Avery Pennarun, Jun 12, 2008
  3. Junio C HamanoJun 13, 2008
  4. Karl HasselströmJun 13, 2008
  5. Avery PennarunJun 13, 2008
  6. Andreas EricssonJun 13, 2008
  7. Karl HasselströmJun 13, 2008
  8. Karl HasselströmJun 14, 2008
  9. Avery PennarunJun 13, 2008

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.