From: Junio C Hamano <gitster@pobox.com>
To: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
Cc: <git@vger.kernel.org>
Subject: Re: Extended splitting for "git add --interactive"
Date: Wed, 26 Nov 2014 10:57:38 -0800 [thread overview]
Message-ID: <xmqq3895rdr1.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5475F7E7020000A100018050@gwsmtp1.uni-regensburg.de> (Ulrich Windl's message of "Wed, 26 Nov 2014 15:55:19 +0100")
"Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de> writes:
> This is for git-1.7.12 (an older version from the SLES11 SP3 SDK). If
> the issue is solved meanwhile, I'll be happy, and I apologize for
> being too lazy to find out.
The answer is no ;-).
> Currently Git cannot split a block of changes like
>
> -AAA
> -BBB
> +CCC
> +DDD
>
> Into
> -AAA
> +CCC
> and
> -BBB
> +DDD
And it is unlikely to do so ever, because it is a wrong thing to do.
What makes the user happy to see above split when the user is
expecting this instead?
-AAA
and
-BBB
+CCC
+DDD
> Another split that is not possible is a split across an empty line, like:
>
> +AAA
> + <empty line (in reality)>
> +BBB
Likewise. An empty line is not that special. AAA may be adding one
block of lines "if (condition) { ... }" and BBB may be another, and
it often happens that you would want to separate these into two
changes, with or without an empty line in between.
+if (foo) {
+ do foo thing
+}
+if (bar) {
+ do bar thing
+}
Having said all that, I am not opposed to a usable idea to allow the
user to specify where in a contiguous block of -*+* to break a hunk
and how.
next prev parent reply other threads:[~2014-11-26 18:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-26 14:55 Extended splitting for "git add --interactive" Ulrich Windl
2014-11-26 18:57 ` Junio C Hamano [this message]
2014-11-26 20:24 ` Junio C Hamano
2014-11-27 8:55 ` Antw: " Ulrich Windl
2014-11-27 10:14 ` Johan Herland
2014-11-27 15:46 ` Brandon McCaig
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=xmqq3895rdr1.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=Ulrich.Windl@rz.uni-regensburg.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.