Thread (13 messages) 13 messages, 3 authors, 2016-06-15

Re: git commit -v does not removes the patch

flat view

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:38

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
But I have to wonder if there is some more robust solution. It seems
like this can have false positives if you include diff output in your
commit message, and a potential false negative if you delete the newline
(e.g., delete everything up to "diff --git", making it the first line).
Actually, I recall (from my googling quite some time ago) people noticing
this, but they learnt to live with it.

We may want to change this.  We can say "# Everything under this line is
deleted." at the beginning of the "#" block we produce in the commit log
message editor, replacing the "Lines starting with '#' will be ignored, "
we currently have.  When reading back the editor result, make "git commit
-v" scan for the "# Everything ..." line.  We remove it and everything
that follows, but we do not touch anything above that line (including the
ones that begin with "diff" or "#") except the usual trailing whitespace
removal.  That way, people can leave a sample shell session with root
prompt, and sample diff, in their message.

If we do not see "# Everything ..." when we read it back, we can do what
we currently do as a fallback.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help