git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] fmt-patch: understand old <his> notation

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 6, 2006, 20:56 UTC
Message-ID
<Pine.LNX.4.63.0605062252530.4155@wbgn013.biozentrum.uni-wuerzburg.de>

When calling "git fmt-patch HEAD~5", you now get the same as if you would have said "git fmt-patch HEAD~5..". This makes it easier for my fingers which are so used to the old syntax.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	I wonder: would it make sense to make add_pending_object() and 
	get_reference() in revision.c non-static?
 builtin-diff.c |    2 +-
 builtin-log.c  |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/builtin-diff.c b/builtin-diff.c
index 636edbf..2087316 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -232,7 +232,7 @@ static int builtin_diff_combined(struct 
 	return 0;
 }
 
-static void add_head(struct rev_info *revs)
+void add_head(struct rev_info *revs)
 {
 	unsigned char sha1[20];
 	struct object *obj;
diff --git a/builtin-log.c b/builtin-log.c
index 0027998..d5bbc1c 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -11,6 +11,9 @@ #include "revision.h"
 #include "log-tree.h"
 #include "builtin.h"
 
+/* this is in builtin-diff.c */
+void add_head(struct rev_info *revs);
+
 static int cmd_log_wc(int argc, const char **argv, char **envp,
 		      struct rev_info *rev)
 {
@@ -185,6 +188,11 @@ int cmd_format_patch(int argc, const cha
 	if (argc > 1)
 		die ("unrecognized argument: %s", argv[1]);
 
+	if (rev.pending_objects && rev.pending_objects->next == NULL) {
+		rev.pending_objects->item->flags |= UNINTERESTING;
+		add_head(&rev);
+	}
+
 	if (!use_stdout)
 		realstdout = fdopen(dup(1), "w");
 
-- 
1.3.1.g9ba6-dirty
Next: Junio C Hamano
Message 1 of 7 in “fmt-patch: understand old <his> notation”
  1. fmt-patch: understand old <his> notationJohannes Schindelin, May 6, 2006
  2. Junio C HamanoMay 6, 2006
  3. Johannes SchindelinMay 6, 2006
  4. Junio C HamanoMay 7, 2006
  5. Linus TorvaldsMay 6, 2006
  6. Olivier GalibertMay 6, 2006
  7. Junio C HamanoMay 7, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.