Re: [PATCH] sha1_name: allow to add @{...} alias via config
- From
- Santi Béjar <santi@agolina.net>
- Date
- Sep 8, 2010, 09:45 UTC
- Message-ID
- <AANLkTimK6MwJHYafAAYNn+h3HD1f0H-BHsQYph4qbCrJ@mail.gmail.com>
- In-Reply-To
- <1283918641-3662-1-git-send-email-pclouds@gmail.com>
2010/9/8 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
Show 13 quoted lines
> This allows users to add new @{..} alias via ref-at.* config
> variables. The rewrite rule is printf-alike.
>
> My itch is I usually work on a topic and only want to see commits in
> that topic. So I make a tag to the topic's base, then do
>
> git log base/my-topic..
>
> That is a lot of keystrokes, and my mind is small enough sometimes I
> don't even remember the topic name, stucking at "base/ what?"
>
> Now I have "ref-at.base = base/%(tip)" in my gitconfig and I only need
> to do "git log @{base}..".I like the idea, but I would like something more generic, a ref transformation or expression (ref-exp?). Currently you can't say %(tip)@{1}, neither %(tip)^, nor origin/master..origin/%(tip).
Another issue is that it can shadow builtin @{}s, like @{upstream}.Why %(tip) and not %(branchname), in line with other %() modifiers.
In particular I have a use case for this @{name}. I would like something like:ref-exp.last = %(tip)@{1}..%(tip)@{0}so I could do:
git log @{last} git log origin/master@{last}
Although another way to get it could be:
git log @{1..0} git log origin/master@{1..0}
Thanks, Santi