From: "Shawn O. Pearce" <spearce@spearce.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Bernt Hansen <bernt@alumni.uwaterloo.ca>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Force new line at end of commit message
Date: Mon, 24 Dec 2007 23:42:02 -0500 [thread overview]
Message-ID: <20071225044202.GO14735@spearce.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0712241835210.14355@wbgn129.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Mon, 24 Dec 2007, Bernt Hansen wrote:
>
> > git rebase --interactive formats the combined commit log message
> > incorrectly when squashing 3 or more commits which have no newline on
> > the last line of the commit message.
>
> This is a patch for git-gui, so why not make that clear in the subject?
> (And I have a hunch that Shawn would have liked the patch relative to
> git-gui.git, not git.git...)
Indeed.
Most git-gui changes have a subject that starts with "git-gui:" so
its clear in both the email and in the commit log that the change is
a git-gui change. Remember, git-gui's logs show up in the core Git
logs (as its merged with -s subtree) so having that git-gui: prefix
does help people to localize the change within the overall suite.
git-am -3 does a reasonable job at correcting patches that are like
this one is (that aren't relative to git-gui.git) so that's less
of an issue for me. And what git-am -3 cannot correct git-apply
-p2 usually does. If that can't fix the patch then I'll usually
throw it back as its then most likely a true conflict.
> Further, there are other tools than rebase -i that like commit messages
> better when terminated by a newline, and _that_ is what I would like to
> read in the commit message for this patch.
Hmmph. For that reason alone I'm tempted to *not* apply Bernt's
patch.
There is nothing that requires that a commit object end with an LF.
So tools that make this assumption (that there is a trailing LF)
while processing the body of a commit message are quite simply
broken.
Its easy in fast-import to generate commits without a trailing LF.
Or in many text editors its possible to save a file with no trailing
LF on the last line. My favorite VI clone does that; if the file
doesn't end with an LF when it opens its *damned* hard to get a
trailing LF onto that last line. And yes, that's the editor I use
for commit messages when I'm not using git-gui.
IMHO git-gui is producing valid commit messages, and always does
so with no trailing LF, and any tool that is assuming a trailing
LF is always present is broken.
Keeping git-gui behavior like this actually highlights the other
tools that are broken (here Bernt found git-rebase--interactive).
I'd like to hear Junio's or Linus' two cents on the matter, but
if we really want to say that all commits must end with an LF then
maybe git-commit-tree, git-hash-object and git-fast-import should be
performing that sort of validation before creating such an object in
the ODB. Which is probably a change that shouldn't be made before
1.6.0 as its somewhat likely to break people's existing scripts.
--
Shawn.
next prev parent reply other threads:[~2007-12-25 4:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-20 0:35 git rebase -i / git-gui bug Bernt Hansen
2007-12-20 4:47 ` Bernt Hansen
2007-12-20 7:12 ` [PATCH] Reallow git-rebase --interactive --continue if commit is unnecessary Shawn O. Pearce
2007-12-20 7:15 ` Junio C Hamano
2007-12-20 7:31 ` Shawn O. Pearce
2007-12-20 9:35 ` Junio C Hamano
2007-12-26 23:48 ` Junio C Hamano
2007-12-29 13:26 ` Johannes Schindelin
2007-12-20 7:52 ` Matthieu Moy
2007-12-24 14:31 ` [PATCH] Force new line at end of commit message Bernt Hansen
2007-12-24 17:38 ` Johannes Schindelin
2007-12-25 4:42 ` Shawn O. Pearce [this message]
2007-12-25 9:34 ` Junio C Hamano
2007-12-26 17:47 ` Bernt Hansen
2007-12-27 4:19 ` Shawn O. Pearce
2007-12-28 2:15 ` [PATCH] git-gui: Make commit log messages end with a newline Bernt Hansen
2007-12-26 19:36 ` [PATCH] Force new line at end of commit message Junio C Hamano
2007-12-29 13:31 ` Johannes Schindelin
2007-12-30 0:19 ` Junio C Hamano
2007-12-30 10:26 ` Johannes Schindelin
2007-12-30 10:51 ` Junio C Hamano
2007-12-30 11:03 ` Johannes Schindelin
2007-12-30 11:45 ` Junio C Hamano
2007-12-30 11:57 ` しらいしななこ
2007-12-30 12:21 ` Junio C Hamano
2007-12-30 12:05 ` Junio C Hamano
2007-12-30 15:50 ` Johannes Schindelin
2007-12-25 4:46 ` Shawn O. Pearce
[not found] <200712301158.lBUBwT3u004608@mi1.bluebottle.com>
2007-12-30 15:51 ` Johannes Schindelin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071225044202.GO14735@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=bernt@alumni.uwaterloo.ca \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.