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
Karl Hasselström <kha@treskal.com>
Date
Jun 13, 2008, 06:29 UTC
Message-ID
<20080613062951.GB24245@diana.vm.bytemark.co.uk>
In-Reply-To
<7vfxrhyjqd.fsf@gitster.siamese.dyndns.org>
On 2008-06-12 22:41:46 -0700, Junio C Hamano wrote:
Show 20 quoted lines
> Avery Pennarun <apenwarr@gmail.com> writes:
>
> > 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.
>
> Perl part of the code looks fine but I am unsure if we like the
> ramifications of this patch on existing git-svn managed
> repositories. Doesn't this change the commit object name on our end
> for almost all of them?

You're correct that this will change the commit id of imported svn revisions -- the new verson of git-svn will give other ids than the old version. However, the only thing that's going to "break" is that two separate imports of the same repository with the two different versions of git-svn will not give the exact same result on the git side.

I think this is a good change, and it would be a pity if this and other changes like it had to be dropped out of a desire to keep the svn -> git transformation function forever fixed. (IIRC, such changes have been allowed in the past -- e.g. 0bed5eaa: "enable follow-parent functionality by default".)

One could imagine a policy of not introducing this kind of change during a stable version, or some such, but historically that's not been the case as far as I can remember.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Junio C HamanoNext: Avery Pennarun
Message 4 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.