git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow format-patch to create patches for merges
@ 2009-01-26 14:04 Nathan W. Panike
  2009-01-26 15:36 ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan W. Panike @ 2009-01-26 14:04 UTC (permalink / raw)
  To: git; +Cc: Nathan W. Panike, Johannes.Schindelin, gitster, aspotashev

The behavior for git format-patch is to ignore merge commits, producing an
empty patch.  The code does not allow the user to change this behavior. This
patch changes that behavior by allowing the user to specify -c or -m at the
command line to produce a patch for a merge commit.
---
Hi:

I am sure there are good reasons for the current behavior of format-patch, but
it seems to me that if the user explicitly wants to produce a patch for a merge
commit, he should be allowed to do so.  If merge_commit represents a merge,
then this patch allows the user to issue the command

git format-patch -m -1 $merge_commit 

or 

git format-patch -c -1 $merge_commit

and actually produce a patch.  The current behavior is that neither command
will produce a patch.  With or without the patch applied, the command

git format-patch -1 $merge_commit

does not produce a patch when merge_commit is a merge.  Thus the patch does not
change the default behavior of ignoring merges, at least by the limited testing
I have done.  

Thanks for your consideration.

Nathan Panike

 builtin-log.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 2ae39af..ea4729d 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -994,10 +994,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 			continue;
 		}
 
-		/* ignore merges */
-		if (commit->parents && commit->parents->next)
-			continue;
-
 		if (ignore_if_in_upstream &&
 				has_commit_patch_id(commit, &ids))
 			continue;
-- 
1.6.1.1.GIT

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-26 21:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 14:04 [PATCH] Allow format-patch to create patches for merges Nathan W. Panike
2009-01-26 15:36 ` Johannes Schindelin
2009-01-26 16:27   ` Nathan W. Panike
2009-01-26 20:45     ` Jeff King
2009-01-26 21:46       ` Nathan W. Panike
2009-01-26 18:33   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).