Re: Another use of "@"?

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Another use of "@"?

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:57:07

Junio C Hamano [off-list ref] writes:
Duy Nguyen [off-list ref] writes:
quoted
My setup is a bit peculiar where I do git development on three
different machines. Say I updated branch long-branch-name on machine
A. Then I continue my work on machine B. I would want to hard reset
that long-branch-name on machine B before resuming my work. What I
usually do is

git co long-branch-name
git diff A/long-branch-name
git reset --hard A/long-branch-name
Perhaps

    git checkout long-bra<TAB>
    git diff A/!$
    git reset --hard !$
I think Duy meant

  git diff A/$(git symbolic-ref --short HEAD)

i.e. "the branch with the same name as the current one, but on a
different remote". If this is the question, then it is a Git thing more
than a shell one.

The A/@ could make sense, but I'm wondering whether we're taking the
direction of implementing some kind of Brainfuck dialect in Git revision
specifiers. I'm not sure we want to add more special characters here and
there with subtly different meanings (@ = HEAD, @{1} = HEAD@{1}, A/@ =
A/$(git symbolic-ref --short HEAD)).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

Re: Another use of "@"?

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:57:08

On Sat, May 4, 2013 at 5:09 AM, Matthieu Moy
[off-list ref] wrote:
The A/@ could make sense, but I'm wondering whether we're taking the
direction of implementing some kind of Brainfuck dialect in Git revision
specifiers. I'm not sure we want to add more special characters here and
there with subtly different meanings (@ = HEAD, @{1} = HEAD@{1}, A/@ =
A/$(git symbolic-ref --short HEAD)).
Another subtle overloading of @ that might be desirable (althought
might be achievable another way). "git log -g"  is equal to "git log
-g HEAD" but there is no easy way (that I know of) to do "git log -g
$(git symbolic-ref HEAD)". "@" could fill the inconvenient spot here,
I think. Alias is no good because I won't be able to add extra
options.
--
Duy

Re: Another use of "@"?

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:57:08

On Sat, May 4, 2013 at 10:26 AM, Duy Nguyen [off-list ref] wrote:
On Sat, May 4, 2013 at 5:09 AM, Matthieu Moy
[off-list ref] wrote:
quoted
The A/@ could make sense, but I'm wondering whether we're taking the
direction of implementing some kind of Brainfuck dialect in Git revision
specifiers. I'm not sure we want to add more special characters here and
there with subtly different meanings (@ = HEAD, @{1} = HEAD@{1}, A/@ =
A/$(git symbolic-ref --short HEAD)).
Another subtle overloading of @ that might be desirable (althought
might be achievable another way). "git log -g"  is equal to "git log
-g HEAD" but there is no easy way (that I know of) to do "git log -g
$(git symbolic-ref HEAD)". "@" could fill the inconvenient spot here,
I think. Alias is no good because I won't be able to add extra
options.
I wouldn't mind typing <ref>@{link} that does "git symbolic-ref
<ref>", though. Because ref is optional, "git log -g @{link}" is not
bad. "link" is probably not a good name for this.
--
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help