{"thread":{"id":"12806","subject":"[PATCH] git add --interactive: Autoselect single patch file","startedAt":"2008-03-22T01:22:40Z","lastAt":"2008-03-22T16:00:44Z","messageCount":4,"participants":["Jörg Sommer","Johannes Schindelin","Wincent Colaiuta"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"72648","messageId":"1206148960-29563-1-git-send-email-joerg@alea.gnuu.de","threadId":"12806","inReplyTo":null,"subject":"[PATCH] git add --interactive: Autoselect single patch file","fromName":"Jörg Sommer","fromEmail":"joerg@alea.gnuu.de","sentAt":"2008-03-22T01:22:40Z","receivedAt":"2008-03-22T01:22:40Z","isPatch":true,"sender":{"key":"joerg@alea.gnuu.de","avatar":null},"body":"If there's only one file to patch, select it automaticly and don't bother\nthe user. In the case he didn't want do patching, he can say 'd' at the\npatch prompt.\n\nSigned-off-by: Jörg Sommer <joerg@alea.gnuu.de>\n---\n git-add--interactive.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex a0a81f1..77ad6fb 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -778,7 +778,7 @@ sub patch_update_cmd {\n \t\tprint STDERR \"No changes.\\n\";\n \t\treturn 0;\n \t}\n-\tif ($patch_mode) {\n+\tif ($patch_mode or @mods == 1) {\n \t\t@them = @mods;\n \t}\n \telse {\n-- \n1.5.4.4\n"},{"id":"72669","messageId":"alpine.LSU.1.00.0803221549570.4124@racer.site","threadId":"12806","inReplyTo":"1206148960-29563-1-git-send-email-joerg@alea.gnuu.de","subject":"Re: [PATCH] git add --interactive: Autoselect single patch file","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-22T14:51:29Z","receivedAt":"2008-03-22T14:51:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 22 Mar 2008, Jörg Sommer wrote:\n\n> If there's only one file to patch, select it automaticly and don't \n> bother the user. In the case he didn't want do patching, he can say 'd' \n> at the patch prompt.\n\nIt also triggers when you specified a single path:\n\n\t$ git add -i that-file.c\n\nI like it.\n\nHowever, if I already specify (a) file(s), could add -i not go to the \n[p]atch option right away?\n\nCiao,\nDscho"},{"id":"72671","messageId":"6AA0A7C2-488B-4440-A797-B1B87361801D@wincent.com","threadId":"12806","inReplyTo":"alpine.LSU.1.00.0803221549570.4124@racer.site","subject":"Re: [PATCH] git add --interactive: Autoselect single patch file","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2008-03-22T15:41:35Z","receivedAt":"2008-03-22T15:41:35Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 22/3/2008, a las 15:51, Johannes Schindelin escribió:\n\n> Hi,\n>\n> On Sat, 22 Mar 2008, Jörg Sommer wrote:\n>\n>> If there's only one file to patch, select it automaticly and don't\n>> bother the user. In the case he didn't want do patching, he can say  \n>> 'd'\n>> at the patch prompt.\n>\n> It also triggers when you specified a single path:\n>\n> \t$ git add -i that-file.c\n>\n> I like it.\n>\n> However, if I already specify (a) file(s), could add -i not go to the\n> [p]atch option right away?\n\nThat's what I originally wanted and I sent a couple of patches in to  \nthat effect some months back. But it was argued that it is useful for  \npassed-in filepatterns to limit the scope of other operations in \"git  \nadd -i\", not just the [p] subcommand, and that in turn lead to the \"-- \npatch\" option being implemented. I can try to dig up the message-ids  \nin question if you are interested.\n\nStill, I use the [p] subcommand so often (and almost never use any of  \nthe other subcommands offered by \"git add -i\") that I have \"git patch\"  \nset up as an alias for \"git add --patch\".\n\nCheers,\nWincent\n"},{"id":"72673","messageId":"alpine.LSU.1.00.0803221700220.4353@racer.site","threadId":"12806","inReplyTo":"6AA0A7C2-488B-4440-A797-B1B87361801D@wincent.com","subject":"Re: [PATCH] git add --interactive: Autoselect single patch file","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-22T16:00:44Z","receivedAt":"2008-03-22T16:00:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 22 Mar 2008, Wincent Colaiuta wrote:\n\n> El 22/3/2008, a las 15:51, Johannes Schindelin escribió:\n> \n> >However, if I already specify (a) file(s), could add -i not go to the \n> >[p]atch option right away?\n> \n> That's what I originally wanted and I sent a couple of patches in to \n> that effect some months back. But it was argued that it is useful for \n> passed-in filepatterns to limit the scope of other operations in \"git \n> add -i\", not just the [p] subcommand, and that in turn lead to the \n> \"--patch\" option being implemented. I can try to dig up the message-ids \n> in question if you are interested.\n> \n> Still, I use the [p] subcommand so often (and almost never use any of \n> the other subcommands offered by \"git add -i\") that I have \"git patch\" \n> set up as an alias for \"git add --patch\".\n\nAh, I missed the --patch option.\n\nThanks,\nDscho\n"}]}