{"thread":{"id":"26848","subject":"Announce: git-number","startedAt":"2011-03-24T04:51:48Z","lastAt":"2011-03-24T05:46:35Z","messageCount":2,"participants":["Nazri Ramliy","Nguyen Thai Ngoc Duy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"164201","messageId":"AANLkTinJTy5OkcU+L=nFVwGMNBepuYgAr-+Jk=OVmG6P@mail.gmail.com","threadId":"26848","inReplyTo":null,"subject":"Announce: git-number","fromName":"Nazri Ramliy","fromEmail":"ayiehere@gmail.com","sentAt":"2011-03-24T04:51:48Z","receivedAt":"2011-03-24T04:51:48Z","isPatch":false,"sender":{"key":"ayiehere@gmail.com","avatar":"https://avatars.githubusercontent.com/u/164756?v=4"},"body":"Hi,\n\nI'd like to announce a little tool that I have been using for the past\nfew years whenever I use git: git-number.\n\ngit-number allows you to use numbers in place of filenames whenever\nyou need to provide them to any git command.\n\nWhen run without argument it will run git-status and prepend a number\nfor each file name that git-status shows, starting from 1:\n\n\t$ git number\n\t# On branch master\n\t# Untracked files:\n\t#   (use \"git add <file>...\" to include in what will be committed)\n\t#\n\t#1      foo/bar/baz/frobnit.fu\n\tnothing added to commit but untracked files present (use \"git add\" to track)\n\nThe output is exactly the same as git status (with color), but with\nnumbers associated with each file that is shown.\n\nNow, instead of writing:\n\n\t$ git add foo/bar/baz/frobnit.fu\n\nYou can just do\n\n\t$ git number add 1\n\nStill that's bit too long for my taste so I have this alias:\n\n\t$ alias gn='git number'\n\nSo that now I can do\n\n\t$ gn add 1\n\nor\n\n\t$ gn reset 15\n\nEven that is a bit too long for my taste, so I have this alias too:\n\n\t$ alias ga='git number add'\n\nSo that I can do this instead:\n\n\t$ ga 1\n\nWhich is equivalent to writing\n\n\t$ git add foo/bar/baz/frobnit.fu\n\nIt also know ranges:\n\n\t$ ga 5-9 11\n\n\nLike it? Get it here: https://github.com/holygeek/git-number\n\nCaveats:\n- It depends on the ouput of git-status, which is porcelain. Caveat emptor.\n- I does not work for renames (#42\trenamed:    a.txt -> b.txt)\n\nThanks.\n\nnazri\n\nP.S. I tried adding it to git wiki but had problem verifying my email, the page\nsaid \"Invalid confirmation code. The code may have expired.\", even on my\nsecond attempt at reconfirming my email.\n"},{"id":"164204","messageId":"AANLkTi==8_hssWSHkR0DTynibtT83iUEq-M_nPO5gN1m@mail.gmail.com","threadId":"26848","inReplyTo":"AANLkTinJTy5OkcU+L=nFVwGMNBepuYgAr-+Jk=OVmG6P@mail.gmail.com","subject":"Re: Announce: git-number","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-03-24T05:46:35Z","receivedAt":"2011-03-24T05:46:35Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Mar 24, 2011 at 11:51 AM, Nazri Ramliy <ayiehere@gmail.com> wrote:\n> Hi,\n>\n> I'd like to announce a little tool that I have been using for the past\n> few years whenever I use git: git-number.\n>\n> git-number allows you to use numbers in place of filenames whenever\n> you need to provide them to any git command.\n>\n> When run without argument it will run git-status and prepend a number\n> for each file name that git-status shows, starting from 1:\n>\n>        $ git number\n>        # On branch master\n>        # Untracked files:\n>        #   (use \"git add <file>...\" to include in what will be committed)\n>        #\n>        #1      foo/bar/baz/frobnit.fu\n>        nothing added to commit but untracked files present (use \"git add\" to track)\n>\n> The output is exactly the same as git status (with color), but with\n> numbers associated with each file that is shown.\n>\n> Now, instead of writing:\n>\n>        $ git add foo/bar/baz/frobnit.fu\n>\n> You can just do\n>\n>        $ git number add 1\n>\n\nNice. I have something similar in a private tool (same problem: too\nlong paths to type). This can be made applicable to a few other\ncommands too, like 'diff --stat'. I think the magic character [1], be\nit ':' or '/', can be used to make this (the syntax is for\ndemostration only):\n\n$ git add :@{1}\n\nequivalent to your 'git number add 1'.\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/169844\n-- \nDuy\n"}]}