Re: [git-users] Highlevel (but simple to implement) commands provided by default for git

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

Re: [git-users] Highlevel (but simple to implement) commands provided by default for git

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:29

Ramkumar Ramachandra [off-list ref] writes:
quoted
        cd Documentation; git blame :/Makefile
*scratches head*
You lean new things every day ;-).
  cd Documentation; git blame ../Makefile

Isn't this how pathspecs are specified everywhere?
The whole point of show-cdup is that people (especially those in
java land) bury themselves in a hierarchy so deep that it is not
feasible to tell "Go count the hierarchy and prefix that many ../
yourself" to them.

The answer to "we cannot count ../" issue is ":(top)" aka ":/" magic
pathspec modifier.

"git blame" takes a single pathname, not "a set of patterns to match
against to select concrete paths", which is what a pathspec is.  

Re: [git-users] Highlevel (but simple to implement) commands provided by default for git

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:29

Junio C Hamano wrote:
The whole point of show-cdup is that people (especially those in
java land) bury themselves in a hierarchy so deep that it is not
feasible to tell "Go count the hierarchy and prefix that many ../
yourself" to them.
Ah.
The answer to "we cannot count ../" issue is ":(top)" aka ":/" magic
pathspec modifier.
I thought :/ was a revspec, which is why I was scratching my head so
hard.  Did we introduce this ambiguity intentionally?

This errors out:

  git log :/Makefile

So, I have to do either of these:

  git log :/Makefile --
  git log -- :/Makefile

depending on what I want.
"git blame" takes a single pathname, not "a set of patterns to match
against to select concrete paths", which is what a pathspec is.
So the problem is that I can't do:

  git blame -- :/Makefile

So blame has to be converted to use pathspec semantics, and should
error out when the pathspec doesn't match the concrete path of a file.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help