git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Sven Helmberger <sven.helmberger@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: Alternative to manual editing with git add --patch
Date: Wed, 14 Oct 2015 18:30:58 +0200	[thread overview]
Message-ID: <vpqeggx9zul.fsf@grenoble-inp.fr> (raw)
In-Reply-To: <561E6FBB.7060302@gmx.de> (Sven Helmberger's message of "Wed, 14 Oct 2015 17:07:39 +0200")

Sven Helmberger <sven.helmberger@gmx.de> writes:

> Hello,
>
> I hope this hasn't been discussed before.
>
> I'm a big fan of cleanliness in commits and therefore often use git add
> --patch to sort code changes I made into the right commits etc.
>
> What I then often encountered was the situation where I happened to have
> inserted consecutive lines of code that conceptually belong to different
> commits. Normally I can nicely split patches, but not in this case,
> making manually editing the patch the only alternative.
>
> Shouldn't there be at least a way to quickly say line-by-line if you
> want to have it added or not?

Many GUI or text-editor plugins for Git allow you to just select lines
and stage the selection. Even though I love "git add -p", I find magit
(Git integration for Emacs) more convenient when it comes to staging
individual lines.

That said, a "split hunk line by line" option for "git add -p" could be
nice.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2015-10-14 16:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 15:07 Alternative to manual editing with git add --patch Sven Helmberger
2015-10-14 16:30 ` Matthieu Moy [this message]
2015-10-14 16:52 ` Johannes Schindelin
2015-10-14 17:50 ` Junio C Hamano
2015-10-14 23:36   ` Sven Helmberger
2015-10-15 10:11     ` Johannes Schindelin
2015-10-15 13:37       ` Sven Helmberger
2015-10-15 15:06         ` Johannes Schindelin
2015-10-15 15:22           ` Sven Helmberger

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=vpqeggx9zul.fsf@grenoble-inp.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=sven.helmberger@gmx.de \
    /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).