All of lore.kernel.org
 help / color / mirror / Atom feed
* how to split a hunk
@ 2009-10-28  2:21 bill lam
  2009-10-28  3:11 ` Geert Bosch
  2009-10-28 13:06 ` Thomas Rast
  0 siblings, 2 replies; 5+ messages in thread
From: bill lam @ 2009-10-28  2:21 UTC (permalink / raw)
  To: git

There are occasions where diff of a file is

- aaaa
+ bbbb
+ cccc

I want to add lines bbbb and cccc as separated commits, but git-add -p
seem cannot further split this hunk.  Do I have no choice but to edit
it by hand and commit the bbbb and then edit the file to add back the
cccc?

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to split a hunk
  2009-10-28  2:21 how to split a hunk bill lam
@ 2009-10-28  3:11 ` Geert Bosch
  2009-10-28 15:26   ` bill lam
  2009-10-28 13:06 ` Thomas Rast
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Bosch @ 2009-10-28  3:11 UTC (permalink / raw)
  To: bill lam; +Cc: git


On Oct 27, 2009, at 22:21, bill lam wrote:

> There are occasions where diff of a file is
>
> - aaaa
> + bbbb
> + cccc
>
> I want to add lines bbbb and cccc as separated commits, but git-add -p
> seem cannot further split this hunk.  Do I have no choice but to edit
> it by hand and commit the bbbb and then edit the file to add back the
> cccc?
>
I like to use "git gui" for this. This allows you to pick individual
lines to commit. I really like the "git gui" interface for staging/ 
unstaging
changes and making a series of commits.

   -Geert

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to split a hunk
  2009-10-28  2:21 how to split a hunk bill lam
  2009-10-28  3:11 ` Geert Bosch
@ 2009-10-28 13:06 ` Thomas Rast
  2009-10-28 15:16   ` bill lam
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Rast @ 2009-10-28 13:06 UTC (permalink / raw)
  To: bill lam; +Cc: git

bill lam wrote:
> There are occasions where diff of a file is
> 
> - aaaa
> + bbbb
> + cccc
> 
> I want to add lines bbbb and cccc as separated commits, but git-add -p
> seem cannot further split this hunk.  Do I have no choice but to edit
> it by hand and commit the bbbb and then edit the file to add back the
> cccc?

There's also the 'git add -p' [e]dit feature, which pops up the patch
in an editor.  There are instructions in that file, but in this case,
you can simply remove one of the additions.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to split a hunk
  2009-10-28 13:06 ` Thomas Rast
@ 2009-10-28 15:16   ` bill lam
  0 siblings, 0 replies; 5+ messages in thread
From: bill lam @ 2009-10-28 15:16 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git

On Wed, 28 Oct 2009, Thomas Rast wrote:
> There's also the 'git add -p' [e]dit feature, which pops up the patch
> in an editor.  There are instructions in that file, but in this case,
> you can simply remove one of the additions.

Thank you for pointing out the [e], incidentally after trying it, I
also noticed and tried the add -e which belongs to a similar format.

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to split a hunk
  2009-10-28  3:11 ` Geert Bosch
@ 2009-10-28 15:26   ` bill lam
  0 siblings, 0 replies; 5+ messages in thread
From: bill lam @ 2009-10-28 15:26 UTC (permalink / raw)
  To: Geert Bosch; +Cc: git

On Tue, 27 Oct 2009, Geert Bosch wrote:
> I like to use "git gui" for this. This allows you to pick individual
> lines to commit. I really like the "git gui" interface for staging/unstaging
> changes and making a series of commits.

Thank you suggestion. However I did not use git-gui/gitk or have tcl
installed.

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-28 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-28  2:21 how to split a hunk bill lam
2009-10-28  3:11 ` Geert Bosch
2009-10-28 15:26   ` bill lam
2009-10-28 13:06 ` Thomas Rast
2009-10-28 15:16   ` bill lam

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.