Re: Announce: git-number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 24, 2011 at 11:51 AM, Nazri Ramliy <ayiehere@xxxxxxxxx> wrote:
> Hi,
>
> I'd like to announce a little tool that I have been using for the past
> few years whenever I use git: git-number.
>
> git-number allows you to use numbers in place of filenames whenever
> you need to provide them to any git command.
>
> When run without argument it will run git-status and prepend a number
> for each file name that git-status shows, starting from 1:
>
> Â Â Â Â$ git number
> Â Â Â Â# On branch master
> Â Â Â Â# Untracked files:
> Â Â Â Â# Â (use "git add <file>..." to include in what will be committed)
> Â Â Â Â#
> Â Â Â Â#1 Â Â Âfoo/bar/baz/frobnit.fu
> Â Â Â Ânothing added to commit but untracked files present (use "git add" to track)
>
> The output is exactly the same as git status (with color), but with
> numbers associated with each file that is shown.
>
> Now, instead of writing:
>
> Â Â Â Â$ git add foo/bar/baz/frobnit.fu
>
> You can just do
>
> Â Â Â Â$ git number add 1
>

Nice. I have something similar in a private tool (same problem: too
long paths to type). This can be made applicable to a few other
commands too, like 'diff --stat'. I think the magic character [1], be
it ':' or '/', can be used to make this (the syntax is for
demostration only):

$ git add :@{1}

equivalent to your 'git number add 1'.

[1] http://article.gmane.org/gmane.comp.version-control.git/169844
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]