Re: [PATCH 5/5] commit: only strip diff from message in verbose mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 12, 2008 at 03:25:52AM -0500, Jeff King wrote:

> +test_expect_success 'diff in message is retained without -v' '
> +	git commit --amend -F diff &&
> +	check_message diff
> +'
> +
> +test_expect_failure 'diff in message is retained with -v' '
> +	git commit --amend -F diff -v &&
> +	check_message diff
> +'

I put in this expect_failure to remind us that we could be doing better.
The solution you proposed would fix this test. Another idea I had was to
use a bogus diff header, and match on that. Something like:

  diff --git --verbose-commit a/file b/file

and searching for "diff --git --verbose-commit", which would not trigger
on any diffs (unless, of course, you were trying to explain how the
verbose mode worked in your commit message :) ).

But that doesn't cover any other special input (i.e., lines beginning
with '#'), and would probably require an ugly hack to the diff machinery
(some diff option for "add these bogus diff command line options").

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux