Re: [PATCH 3/2] format-patch: use clear_commit_marks() instead of some adhocery

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 3/2] format-patch: use clear_commit_marks() instead of some adhocery

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:31

Johannes Schindelin [off-list ref] writes:
quoted
quoted
Could you test with "origin..master" instead of "origin master"?
Funny you mention that! Now it works ;-) and it even produces the
patches I would expect.
The funny thing is: I did something to account for the old syntax, but 
only if you specified _one_ ref, not _two_. It would be easy, but is it 
needed? (I.e. are your fingers so trained on it?)
If possible I'd rather correct the two syntaxes once and for all now.
Maybe accept two with a warning for deprecation?

[PATCH] format-patch: support really old non-range syntax, with a warning

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:31

Now you can say (again)

	git format-patch <theirs> <mine>

Signed-off-by: Johannes Schindelin <redacted>

---


	Re: [PATCH 3/2] format-patch: use clear_commit_marks() instead of some 
	adhocery

	On Mon, 26 Jun 2006, Junio C Hamano wrote:

	> Johannes Schindelin [off-list ref] writes:
	> 
	> >> > Could you test with "origin..master" instead of "origin master"?
	> >> 
	> >> Funny you mention that! Now it works ;-) and it even produces the
	> >> patches I would expect.
	> >
	> > The funny thing is: I did something to account for the old syntax, but 
	> > only if you specified _one_ ref, not _two_. It would be easy, but is it 
	> > needed? (I.e. are your fingers so trained on it?)
	> 
	> If possible I'd rather correct the two syntaxes once and for all now.
	> Maybe accept two with a warning for deprecation?

	Here you are. (Tested once -- works great!)

 builtin-log.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 44d2d13..64b2830 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -260,6 +260,11 @@ int cmd_format_patch(int argc, const cha
 	if (rev.pending.nr == 1) {
 		rev.pending.objects[0].item->flags |= UNINTERESTING;
 		add_head(&rev);
+	} else if (rev.pending.nr == 2
+			&& !(rev.pending.objects[0].item->flags & UNINTERESTING)
+			&& !(rev.pending.objects[1].item->flags & UNINTERESTING)) {
+		rev.pending.objects[0].item->flags |= UNINTERESTING;
+		fprintf(stderr, "WARNING: obsolete syntax (no range)!\n");
 	}
 
 	if (!use_stdout)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help