git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco Costalba" <mcostalba@gmail.com>
To: "Yann Dirson" <ydirson@altern.org>
Cc: junkio@cox.net, "GIT list" <git@vger.kernel.org>
Subject: Re: [PATCH] git-commit: filter out log message lines only when editor was run.
Date: Sun, 25 Jun 2006 09:08:02 +0200	[thread overview]
Message-ID: <e5bfff550606250008k702acfadm8860e9b672bced56@mail.gmail.com> (raw)
In-Reply-To: <20060624094217.GB7851@nowhere.earth>

On 6/24/06, Yann Dirson <ydirson@altern.org> wrote:
> Junio wrote:
> > I agree with this in principle but we would need to make sure
> > that our own scripts do not expect that the message is cleaned
> > up when feeding a commit log message via stdin, -m or -F, and if
> > they do fix them before applying this patch.
>
> The only tools in git.git I could identify as using git-commit rather
> than commit-tree are:
>
> git-revert.sh: OK
> git-rebase.sh: only uses -C
>
> cogito, stgit, and pg also use commit-tree.  Only qgit seems to be
> using git-commit, and probably makes use of this (mis)feature.
>

Yes, qgit uses git-commit, but issue is different.

qgit uses the output of git status as a 'default text' used in the
commit dialog. When commit button is pressed, after some message
editing by the user,  the comment lines are stripped _before_ to save
the content of commit message in a temporary file to be used by
git-commit with -F option.

The comment stripping is done by this code:

	msg = textEditMsg->text();
	msg.remove(QRegExp("\\n\\s*#[^\\n]*")); // strip comments
	msg.replace(QRegExp("[ \\t\\r\\f\\v]+\\n"), "\n"); // strip line trailing cruft
	msg = msg.stripWhiteSpace();

as you see it rely on the  '#' character.

So conclusions are:

1) It's ok to let git-comit do not strip comment lines, it's already
done by qgit.

2) Please don't change git status output to use another symbol to mark
comment lines because it will break line stripping code.

        Marco

  reply	other threads:[~2006-06-25  7:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-24  9:42 [PATCH] git-commit: filter out log message lines only when editor was run Yann Dirson
2006-06-25  7:08 ` Marco Costalba [this message]
2006-06-25  7:21   ` Yann Dirson
  -- strict thread matches above, loose matches on Subject: below --
2006-06-23 22:04 Yann Dirson
2006-06-24  0:21 ` Junio C Hamano

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=e5bfff550606250008k702acfadm8860e9b672bced56@mail.gmail.com \
    --to=mcostalba@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=ydirson@altern.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).