* staging specific lines out of a hunk for a commit
@ 2010-09-21 10:40 Graeme Geldenhuys
2010-09-21 10:52 ` Bert Wesarg
2010-09-21 11:09 ` Jonathan del Strother
0 siblings, 2 replies; 6+ messages in thread
From: Graeme Geldenhuys @ 2010-09-21 10:40 UTC (permalink / raw)
To: git
Hi,
I know 'git gui' has this cool feature where you can stage one line at
a time. This is really handy, but also very annoying, if you have a
large piece of code you want to commit.
eg: I have a single hunk, which can't be split into smaller hunks
because it is all new code. But that hunk fixes a few bugs, or
introduces a few new features.
Is there a way to use 'git add -i' or 'git add -p' or 'git gui' and
tell it to add for example lines 5-20 of the hunk to the index?
Currently with 'git gui', I have to right click and select 'Stage line
for commit' 15+ times! :-(
Maybe 'gui gui' can be enhance (don't know if development work is
continuing on gui gui') to use the same feature as in the "unstaged
changes" area of the UI. There you can simply click the icon next to
the file name to add that file. Maybe the same could be implemented to
the "diff" area of the UI. Simply click the first column in the diff
area (where the '+' or '-' or ' ' appears), to add those lines to the
index. This will make adding or removing line to/from a commit so much
quicker and easier than the popup menu.
I'm using git-gui 0.12.0.64 and git version 1.7.0.4.
--
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: staging specific lines out of a hunk for a commit
2010-09-21 10:40 staging specific lines out of a hunk for a commit Graeme Geldenhuys
@ 2010-09-21 10:52 ` Bert Wesarg
2010-09-21 11:00 ` Graeme Geldenhuys
2010-09-21 11:09 ` Jonathan del Strother
1 sibling, 1 reply; 6+ messages in thread
From: Bert Wesarg @ 2010-09-21 10:52 UTC (permalink / raw)
To: Graeme Geldenhuys; +Cc: git
Hi,
On Tue, Sep 21, 2010 at 12:40, Graeme Geldenhuys
<graemeg.lists@gmail.com> wrote:
> Hi,
>
> I know 'git gui' has this cool feature where you can stage one line at
> a time. This is really handy, but also very annoying, if you have a
> large piece of code you want to commit.
>
> eg: I have a single hunk, which can't be split into smaller hunks
> because it is all new code. But that hunk fixes a few bugs, or
> introduces a few new features.
>
> Is there a way to use 'git add -i' or 'git add -p' or 'git gui' and
> tell it to add for example lines 5-20 of the hunk to the index?
> Currently with 'git gui', I have to right click and select 'Stage line
> for commit' 15+ times! :-(
Just select the lines you would like to add, and than you can stage
them at once.
>
> I'm using git-gui 0.12.0.64 and git version 1.7.0.4.
But I don't know since when this feature is available.
Bert
>
> --
> Regards,
> - Graeme -
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: staging specific lines out of a hunk for a commit
2010-09-21 10:52 ` Bert Wesarg
@ 2010-09-21 11:00 ` Graeme Geldenhuys
2010-09-21 11:31 ` Matthieu Moy
0 siblings, 1 reply; 6+ messages in thread
From: Graeme Geldenhuys @ 2010-09-21 11:00 UTC (permalink / raw)
To: git
On 21 September 2010 12:52, Bert Wesarg wrote:
>
> Just select the lines you would like to add, and than you can stage
> them at once.
I tried that last night on my home laptop and it didn't work. Trying
it now at work, it indeed does work. Clearly my git versions are
different - when I thought they were the same. Thanks for the help.
--
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: staging specific lines out of a hunk for a commit
2010-09-21 11:00 ` Graeme Geldenhuys
@ 2010-09-21 11:31 ` Matthieu Moy
2010-09-21 11:44 ` Graeme Geldenhuys
0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Moy @ 2010-09-21 11:31 UTC (permalink / raw)
To: Graeme Geldenhuys; +Cc: git
Graeme Geldenhuys <graemeg.lists@gmail.com> writes:
> On 21 September 2010 12:52, Bert Wesarg wrote:
>>
>> Just select the lines you would like to add, and than you can stage
>> them at once.
>
> I tried that last night on my home laptop and it didn't work. Trying
> it now at work, it indeed does work. Clearly my git versions are
> different - when I thought they were the same. Thanks for the help.
Otherwise, "git add -p", 'e' for 'e'dit, and delete the parts you
don't want.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: staging specific lines out of a hunk for a commit
2010-09-21 10:40 staging specific lines out of a hunk for a commit Graeme Geldenhuys
2010-09-21 10:52 ` Bert Wesarg
@ 2010-09-21 11:09 ` Jonathan del Strother
1 sibling, 0 replies; 6+ messages in thread
From: Jonathan del Strother @ 2010-09-21 11:09 UTC (permalink / raw)
To: Graeme Geldenhuys; +Cc: git
On 21 September 2010 11:40, Graeme Geldenhuys <graemeg.lists@gmail.com> wrote:
> Hi,
>
> I know 'git gui' has this cool feature where you can stage one line at
> a time. This is really handy, but also very annoying, if you have a
> large piece of code you want to commit.
>
> eg: I have a single hunk, which can't be split into smaller hunks
> because it is all new code. But that hunk fixes a few bugs, or
> introduces a few new features.
>
> Is there a way to use 'git add -i' or 'git add -p' or 'git gui' and
> tell it to add for example lines 5-20 of the hunk to the index?
> Currently with 'git gui', I have to right click and select 'Stage line
> for commit' 15+ times! :-(
>
If you happen to be on a Mac, gitx allows you to select the lines
you're interested in with the mouse and stage them.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-09-21 12:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 10:40 staging specific lines out of a hunk for a commit Graeme Geldenhuys
2010-09-21 10:52 ` Bert Wesarg
2010-09-21 11:00 ` Graeme Geldenhuys
2010-09-21 11:31 ` Matthieu Moy
2010-09-21 11:44 ` Graeme Geldenhuys
2010-09-21 11:09 ` Jonathan del Strother
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).