git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matan Nassau <matan.nassau@gmail.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Bug: commit -p breaks with -m
Date: Thu, 15 Aug 2013 00:43:39 -0400	[thread overview]
Message-ID: <6EC98F2F-98FC-439B-BD9C-B1D0DB1F5E10@gmail.com> (raw)

With git 1.8.3.3,

 $ seq 5 >data
 $ git add data
 $ git commit -mdata
 $ sed -i '2 d' data
 $ git commit -pmchange

At the prompt, type e to edit the hunk. The editor doesn't start, but git records a commit.

I found that builtin/commit.c sets the GIT_EDITOR env var to ":" when the user specifies the -m option. This was done in 406400ce4f69. Removing these two lines,

 if (!use_editor)
     setenv("GIT_EDITOR", ":", 1);

seems to fix the issue, but I'm not sure this won't break the prepare-commit-msg hook. I'd like to submit a patch: can I get a hint if this change would break commit hooks or anything else I'm not seeing?

             reply	other threads:[~2013-08-15  4:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15  4:43 Matan Nassau [this message]
2013-08-15 12:16 ` Bug: commit -p breaks with -m Jeff King
2013-08-15 17:28   ` Junio C Hamano
2013-08-15 17:31     ` Jeff King

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=6EC98F2F-98FC-439B-BD9C-B1D0DB1F5E10@gmail.com \
    --to=matan.nassau@gmail.com \
    --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.
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).