git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: David Miller <davem@davemloft.net>
Cc: git@vger.kernel.org
Subject: Re: format-patch on permission change gives empty patch
Date: Wed, 06 Oct 2010 21:13:35 -0700	[thread overview]
Message-ID: <7vtykyy70w.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 20101006.174008.70175671.davem@davemloft.net

David Miller <davem@davemloft.net> writes:

> From: David Miller <davem@davemloft.net>
> Date: Wed, 06 Oct 2010 17:37:14 -0700 (PDT)
>
>> 
>> When I ask git to format-patch a commit that is just a file
>> permission change, it ends up generating an empty file, not
>> even the commit message is included.
>
> Ok it turns out that the commit in question was a NOP since the file
> permissions didn't change.
>
> But even if the patch is truly empty, format-patch should still give
> me the commit message shouldn't it?

Probably; we have strongly encouraged people not to commit no-op, so I
guess nobody stumbled upon this corner case.

Perhaps something like this?

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

diff --git a/builtin/log.c b/builtin/log.c
index 22d1290..6baba7d 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1057,6 +1057,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	rev.verbose_header = 1;
 	rev.diff = 1;
 	rev.no_merges = 1;
+	rev.always_show_header = 1;
 	DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
 	rev.subject_prefix = fmt_patch_subject_prefix;
 	memset(&s_r_opt, 0, sizeof(s_r_opt));

  reply	other threads:[~2010-10-07  4:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07  0:37 format-patch on permission change gives empty patch David Miller
2010-10-07  0:40 ` David Miller
2010-10-07  4:13   ` Junio C Hamano [this message]
2010-10-07  4:40     ` Junio C Hamano
2010-10-07  8:15       ` Sverre Rabbelier
2010-10-07 10:05         ` Jakub Narebski
2010-10-07 10:12           ` Sverre Rabbelier
2010-10-07 19:06       ` Nicolas Pitre
2010-10-07 20:29         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vtykyy70w.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=davem@davemloft.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).