{"thread":{"id":"25181","subject":"staging specific lines out of a hunk for a commit","startedAt":"2010-09-21T10:40:35Z","lastAt":"2010-09-21T11:44:27Z","messageCount":6,"participants":["Graeme Geldenhuys","Bert Wesarg","Matthieu Moy","Jonathan del Strother"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"151198","messageId":"AANLkTin4U78N_8LV8fCWuinNH9AFeOsRBjnvHM0qt2ZH@mail.gmail.com","threadId":"25181","inReplyTo":null,"subject":"staging specific lines out of a hunk for a commit","fromName":"Graeme Geldenhuys","fromEmail":"graemeg.lists@gmail.com","sentAt":"2010-09-21T10:40:35Z","receivedAt":"2010-09-21T10:40:35Z","isPatch":false,"sender":{"key":"graemeg.lists@gmail.com","avatar":null},"body":"Hi,\n\nI know 'git gui' has this cool feature where you can stage one line at\na time. This is really handy, but also very annoying, if you have a\nlarge piece of code you want to commit.\n\neg: I have a single hunk, which can't be split into smaller hunks\nbecause it is all new code. But that hunk fixes a few bugs, or\nintroduces a few new features.\n\nIs there a way to use 'git add -i' or 'git add -p' or 'git gui' and\ntell it to add for example lines 5-20 of the hunk to the index?\nCurrently with 'git gui', I have to right click and select 'Stage line\nfor commit' 15+ times! :-(\n\nMaybe 'gui gui' can be enhance (don't know if development work is\ncontinuing on gui gui') to use the same feature as in the \"unstaged\nchanges\" area of the UI. There you can simply click the icon next to\nthe file name to add that file. Maybe the same could be implemented to\nthe \"diff\" area of the UI. Simply click the first column in the diff\narea (where the '+' or '-' or ' ' appears), to add those lines to the\nindex. This will make adding or removing line to/from a commit so much\nquicker and easier than the popup menu.\n\nI'm using git-gui 0.12.0.64 and git version 1.7.0.4.\n\n-- \nRegards,\n  - Graeme -\n\n\n_______________________________________________\nfpGUI - a cross-platform Free Pascal GUI toolkit\nhttp://opensoft.homeip.net:8080/fpgui/\n"},{"id":"151199","messageId":"AANLkTim=FQyBHcaHEX92YLgODrvpesuA7e4xwXuWcFg4@mail.gmail.com","threadId":"25181","inReplyTo":"AANLkTin4U78N_8LV8fCWuinNH9AFeOsRBjnvHM0qt2ZH@mail.gmail.com","subject":"Re: staging specific lines out of a hunk for a commit","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-09-21T10:52:38Z","receivedAt":"2010-09-21T10:52:38Z","isPatch":false,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"Hi,\n\nOn Tue, Sep 21, 2010 at 12:40, Graeme Geldenhuys\n<graemeg.lists@gmail.com> wrote:\n> Hi,\n>\n> I know 'git gui' has this cool feature where you can stage one line at\n> a time. This is really handy, but also very annoying, if you have a\n> large piece of code you want to commit.\n>\n> eg: I have a single hunk, which can't be split into smaller hunks\n> because it is all new code. But that hunk fixes a few bugs, or\n> introduces a few new features.\n>\n> Is there a way to use 'git add -i' or 'git add -p' or 'git gui' and\n> tell it to add for example lines 5-20 of the hunk to the index?\n> Currently with 'git gui', I have to right click and select 'Stage line\n> for commit' 15+ times! :-(\n\nJust select the lines you would like to add, and than you can stage\nthem at once.\n\n>\n> I'm using git-gui 0.12.0.64 and git version 1.7.0.4.\n\nBut I don't know since when this feature is available.\n\nBert\n\n\n>\n> --\n> Regards,\n>   - Graeme -\n"},{"id":"151201","messageId":"AANLkTinJRT7x-TS0R1C00-djVk3rKOt_Axys+orBhZfx@mail.gmail.com","threadId":"25181","inReplyTo":"AANLkTim=FQyBHcaHEX92YLgODrvpesuA7e4xwXuWcFg4@mail.gmail.com","subject":"Re: staging specific lines out of a hunk for a commit","fromName":"Graeme Geldenhuys","fromEmail":"graemeg.lists@gmail.com","sentAt":"2010-09-21T11:00:39Z","receivedAt":"2010-09-21T11:00:39Z","isPatch":false,"sender":{"key":"graemeg.lists@gmail.com","avatar":null},"body":"On 21 September 2010 12:52, Bert Wesarg wrote:\n>\n> Just select the lines you would like to add, and than you can stage\n> them at once.\n\nI tried that last night on my home laptop and it didn't work. Trying\nit now at work, it indeed does work. Clearly my git versions are\ndifferent - when I thought they were the same. Thanks for the help.\n\n\n-- \nRegards,\n  - Graeme -\n\n\n_______________________________________________\nfpGUI - a cross-platform Free Pascal GUI toolkit\nhttp://opensoft.homeip.net:8080/fpgui/\n"},{"id":"151207","messageId":"AANLkTimOPSbG=VqqReMqbQicYygxbHQsniwS5WDvA1z4@mail.gmail.com","threadId":"25181","inReplyTo":"AANLkTin4U78N_8LV8fCWuinNH9AFeOsRBjnvHM0qt2ZH@mail.gmail.com","subject":"Re: staging specific lines out of a hunk for a commit","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2010-09-21T11:09:09Z","receivedAt":"2010-09-21T11:09:09Z","isPatch":false,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"On 21 September 2010 11:40, Graeme Geldenhuys <graemeg.lists@gmail.com> wrote:\n> Hi,\n>\n> I know 'git gui' has this cool feature where you can stage one line at\n> a time. This is really handy, but also very annoying, if you have a\n> large piece of code you want to commit.\n>\n> eg: I have a single hunk, which can't be split into smaller hunks\n> because it is all new code. But that hunk fixes a few bugs, or\n> introduces a few new features.\n>\n> Is there a way to use 'git add -i' or 'git add -p' or 'git gui' and\n> tell it to add for example lines 5-20 of the hunk to the index?\n> Currently with 'git gui', I have to right click and select 'Stage line\n> for commit' 15+ times! :-(\n>\n\nIf you happen to be on a Mac, gitx allows you to select the lines\nyou're interested in with the mouse and stage them.\n"},{"id":"151203","messageId":"vpqocbrjpts.fsf@bauges.imag.fr","threadId":"25181","inReplyTo":"AANLkTinJRT7x-TS0R1C00-djVk3rKOt_Axys+orBhZfx@mail.gmail.com","subject":"Re: staging specific lines out of a hunk for a commit","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-09-21T11:31:11Z","receivedAt":"2010-09-21T11:31:11Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Graeme Geldenhuys <graemeg.lists@gmail.com> writes:\n\n> On 21 September 2010 12:52, Bert Wesarg wrote:\n>>\n>> Just select the lines you would like to add, and than you can stage\n>> them at once.\n>\n> I tried that last night on my home laptop and it didn't work. Trying\n> it now at work, it indeed does work. Clearly my git versions are\n> different - when I thought they were the same. Thanks for the help.\n\nOtherwise, \"git add -p\", 'e' for 'e'dit, and delete the parts you\ndon't want.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"151204","messageId":"AANLkTimH5T8uKppW5PPe501OCVVRuLBtWfeSbUxka9Ov@mail.gmail.com","threadId":"25181","inReplyTo":"vpqocbrjpts.fsf@bauges.imag.fr","subject":"Re: staging specific lines out of a hunk for a commit","fromName":"Graeme Geldenhuys","fromEmail":"graemeg.lists@gmail.com","sentAt":"2010-09-21T11:44:27Z","receivedAt":"2010-09-21T11:44:27Z","isPatch":false,"sender":{"key":"graemeg.lists@gmail.com","avatar":null},"body":"On 21 September 2010 13:31, Matthieu Moy wrote:\n>\n> Otherwise, \"git add -p\", 'e' for 'e'dit, and delete the parts you\n> don't want.\n\nHa, I was wondering about that, but wasn't sure if it would be\naccepted or cause problems. Thanks for the tip.\n\n\n-- \nRegards,\n  - Graeme -\n\n\n_______________________________________________\nfpGUI - a cross-platform Free Pascal GUI toolkit\nhttp://opensoft.homeip.net:8080/fpgui/\n"}]}