Re: [PATCH] interpret-trailers: obey scissors lines

2017-05-15 Thread Brian Malehorn
Alright, I've made a new patch based on this feedback: * make indentation consistent with rest of test file again * rename function to wt_status_locate_end() * rephrase commit message; add paragraph about wt_status_locate_end() * s/scissors/cut line/ * Signed-off-by: me > The mention of "'commit

[PATCH] interpret-trailers: honor the cut line

2017-05-15 Thread Brian Malehorn
ncate_message_at_cut_line() in cmd_commit(), rewrite it to call wt_status_locate_end() helper instead and remove the old helper that no longer has any caller. Signed-off-by: Brian Malehorn --- builtin/commit.c | 2 +- commit.c | 13 +++-- t/

[PATCH] interpret-trailers: obey scissors lines

2017-05-14 Thread Brian Malehorn
If a commit message is being edited as "verbose", it will contain a scissors string ("-- >8 --") and a diff: my subject # >8 # Do not touch the line above. # Everything below will be removed. diff --git a/foo.txt b/foo.txt

Re: [PATCH] interpret-trailers: obey scissors lines

2017-05-14 Thread Brian Malehorn
> One, we'd usually use "\EOF" here unless you > really do want to interpolate inside the here document. Fixed, and I learned something new. > And two, we usually indent the contents to the same level as the outer > cat/EOF pair Fixed. I was indenting the same as the other tests in that file.

Re: [PATCH 0/3] interpret-trailers + commit -v bugfix

2017-05-13 Thread Brian Malehorn
> As I said, I'm a little iffy on doing this unconditionally, but it may > be the least-bad solution. I'd just worry about collateral damage to > somebody who doesn't use commit.verbose, but has something scissors-like > in their commit message. > > If you were to switch out is_scissors_line() fo

[PATCH] interpret-trailers: obey scissors lines

2017-05-13 Thread Brian Malehorn
If a commit message is being editted as "verbose", it will contain a scissors string ("-- >8 --") and a diff: my subject # >8 # Do not touch the line above. # Everything below will be removed. diff --git a/foo.txt b/foo.txt

[PATCH 2/3] commit.c: add is_scissors_line

2017-05-11 Thread Brian Malehorn
Move is_scissors_line to commit.c and expose it through commit.h. This is needed in commit.c, and mailinfo.c shouldn't really own it. --- commit.c | 52 commit.h | 1 + mailinfo.c | 53 +

[PATCH 3/3] commit.c: skip scissors when computing trailers

2017-05-11 Thread Brian Malehorn
"scissors" ("- >8 -") can be automatically added to commit messages by setting commit.verbose = true. Prevent this from interfering with trailer calculations by automatically skipping over scissors, instead of (usually) treating them as a comment. --- commit.c | 13 +++

[PATCH 1/3] mailinfo.c: is_scissors_line ends on newline

2017-05-11 Thread Brian Malehorn
Needed to work with git interpret-trailers. Since "line" is, of course, a line, it will always end with "\n\0" and therefore we can safely end on "\n". --- mailinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailinfo.c b/mailinfo.c index a489d9d0f..eadd0597f 100644 --- a

[PATCH 0/3] interpret-trailers + commit -v bugfix

2017-05-11 Thread Brian Malehorn
Hi all, This patch series addresses a bug in interpret-trailers. If the commit that is being editted is "verbose", it will contain a scissors string ("-- >8 --") and a diff. interpret-trailers doesn't interpret the scissors and therefore places trailer information after the diff. A simple reprodu