{"thread":{"id":"44298","subject":"Can we make interactive add easier to use?","startedAt":"2016-10-14T13:21:17Z","lastAt":"2016-10-16T00:34:24Z","messageCount":3,"participants":["Robert Dailey","Matthieu Moy","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"304135","messageId":"CAHd499AnuVximRgM0MKdq5JC-hwkrhox6bK_KA+XGrawoz2W+g@mail.gmail.com","threadId":"44298","inReplyTo":null,"subject":"Can we make interactive add easier to use?","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2016-10-14T13:20:40Z","receivedAt":"2016-10-14T13:21:17Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"Normally when I use interactive add, I just want to add files to the\nindex via simple numbers, instead of typing paths. So I'll do this as\nquick as I can:\n\n1. Type `git add -i`\n2. Press `u` after prompt appears\n3. Press numbers for the files I want to add, ENTER key\n4. ENTER key again to go back to main add -i menu\n5. Press `q` to exit interactive add\n6. Type `git commit`\n\nThis feels very tedious. Is there a simplified workflow for this? I\nremember using a \"git index\" unofficial extension to git that let you\ndo a `git status` that showed numbers next to each item (including\nuntracked files!) and you could do `git add 1, 2, 3-5`, etc.\n\nThoughts? Even though this feels like I'm complaining, honestly I am\njust consulting the experts here to see if I'm missing out on some\nusability features. Thanks in advance!!\n"},{"id":"304139","messageId":"vpqfunz2gc9.fsf@anie.imag.fr","threadId":"44298","inReplyTo":"CAHd499AnuVximRgM0MKdq5JC-hwkrhox6bK_KA+XGrawoz2W+g@mail.gmail.com","subject":"Re: Can we make interactive add easier to use?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-10-14T13:46:46Z","receivedAt":"2016-10-14T13:47:07Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Robert Dailey <rcdailey.lists@gmail.com> writes:\n\n> Normally when I use interactive add, I just want to add files to the\n> index via simple numbers, instead of typing paths. So I'll do this as\n> quick as I can:\n>\n> 1. Type `git add -i`\n> 2. Press `u` after prompt appears\n> 3. Press numbers for the files I want to add, ENTER key\n> 4. ENTER key again to go back to main add -i menu\n> 5. Press `q` to exit interactive add\n> 6. Type `git commit`\n>\n> This feels very tedious. Is there a simplified workflow for this?\n\nMy workflow is to ... not use \"git add -i\" ;-).\n\nTo add patch hunks individually, \"git add -p\" jumps directly to the\n\"patch\" inner loop of \"git add -i\".\n\nTo add whole individual files, a plain \"git add\" using zsh's smart\ncompletion (autocompletes only files for which \"git add\" is not a\nno-op), or globs.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"304214","messageId":"20161014191254.stzzffyxk6ih3cwx@sigill.intra.peff.net","threadId":"44298","inReplyTo":"CAHd499AnuVximRgM0MKdq5JC-hwkrhox6bK_KA+XGrawoz2W+g@mail.gmail.com","subject":"Re: Can we make interactive add easier to use?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-10-14T19:12:54Z","receivedAt":"2016-10-16T00:34:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 14, 2016 at 08:20:40AM -0500, Robert Dailey wrote:\n\n> Normally when I use interactive add, I just want to add files to the\n> index via simple numbers, instead of typing paths. So I'll do this as\n> quick as I can:\n\nI'd generally second Matthieu's suggestion to use a combination of \"git\nadd\" and \"git add -p\". But if you really like the interactive updater,\nthen the optimizations I can think of are:\n\n> 1. Type `git add -i`\n> 2. Press `u` after prompt appears\n> 3. Press numbers for the files I want to add, ENTER key\n> 4. ENTER key again to go back to main add -i menu\n> 5. Press `q` to exit interactive add\n> 6. Type `git commit`\n\nWe have \"git add -p\" to avoid having to do a similar workflow just to\nget to the \"p\"atch menu. So in theory we could have a similar shortcut\nto get to \"u\"pdate. I think it's just not in common enough use that\nanybody really bothered to implement it.\n\nWe also have \"commit -p\" (and \"commit -i\") already, though I do not use\nthem myself.\n\nThat would probably take you down to:\n\n  1. git commit --iu ;# obviously a terrible option name\n  2. Press numbers, then ENTER\n  3. 'q' or ENTER or ^D to exit, and jump into commit message\n     automatically.\n\nYou can also set the interactive.singleKey config option to turn (2)\ninto just \"press numbers\" (which works right now).\n\n> This feels very tedious. Is there a simplified workflow for this? I\n> remember using a \"git index\" unofficial extension to git that let you\n> do a `git status` that showed numbers next to each item (including\n> untracked files!) and you could do `git add 1, 2, 3-5`, etc.\n\nTBH, that extension sounds a lot more generically useful, as it works at\nthe shell level. I _think_ I've seen similar features implemented that\nare not even git specific (i.e., they work off of existing\nshell-completion libraries and just let you pick the options by number\nrather than tab-completing). Sorry I don't have any links, though. It's\nnot something I ever used myself.\n\n-Peff\n"}]}