git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: paulus@samba.org
Cc: git@vger.kernel.org, Chris Packham <judge.packham@gmail.com>
Subject: [gitk PATCH] gitk: Default wrcomcmd to use --pretty=email
Date: Sun,  2 Nov 2014 21:40:10 +1300	[thread overview]
Message-ID: <1414917610-13508-1-git-send-email-judge.packham@gmail.com> (raw)

This makes the "Write commit to file" context menu option generate a file that
is consumable by 'git am'.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
Hi Paul,

This is the other side of a git patch I was looking at a while ago[1]. The basic
problem was people were using gitk's "Write commit to file" functionality to
generate patches for me to apply. It was hard to convince git am to consume these.

Eventually after some pointers from Junio I realised that if gitk just used
 --pretty=email then it would generate files that were consumable by git am.
Just adding =email is the minimal change to make things work but it might be a
good idea to add --stat to make it more patch-like (or just switch to using
format-patch).
--
[1] - http://article.gmane.org/gmane.comp.version-control.git/256424
[2] - http://article.gmane.org/gmane.comp.version-control.git/256543

 gitk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gitk b/gitk
index 78358a7..462f966 100755
--- a/gitk
+++ b/gitk
@@ -11936,7 +11936,7 @@ if { [info exists ::env(GIT_TRACE)] } {
 }
 
 # defaults...
-set wrcomcmd "git diff-tree --stdin -p --pretty"
+set wrcomcmd "git diff-tree --stdin -p --pretty=email"
 
 set gitencoding {}
 catch {
-- 
2.0.4

                 reply	other threads:[~2014-11-02  8:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=1414917610-13508-1-git-send-email-judge.packham@gmail.com \
    --to=judge.packham@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.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.
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).