git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rev-parse doesn't take pwd into consideration
@ 2008-05-26 19:58 Luciano Rocha
  2008-05-26 20:15 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Luciano Rocha @ 2008-05-26 19:58 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]


Hello,

I was frustrated for some minutes trying to get the HEAD version of a
file, as is in the documentation. Using git's source as an example:
git/Documentation$ git show HEAD:docbook.xsl
fatal: ambiguous argument 'HEAD:docbook.xsl': unknown revision or path
not in the working tree.
Use '--' to separate paths from revisions

<hmmm>

$ git show HEAD -- docbook.xsl
<nil>
$

Seeing in the documentation that the parsing was made by git-rev-parse,
I tried running git-rev-parse directly, ending with the same error.

I tried with the full path, just in case, but it didn't work also
($PWD/docbook.xsl).

Until finally I tried the absolute path as git is concerned, and it
worked.

It works anywhere:
git$ git show HEAD:Documentation/docbook.xsl
<contents>
git/Documentation$ git show HEAD:Documentation/docbook.xsl
<contents>
...

Is it difficult to make rev-parse accept relative path specifications?

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 19:58 rev-parse doesn't take pwd into consideration Luciano Rocha
@ 2008-05-26 20:15 ` Junio C Hamano
  2008-05-26 21:42   ` Johannes Schindelin
  2008-05-26 20:18 ` Teemu Likonen
  2008-05-26 21:35 ` しらいしななこ
  2 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2008-05-26 20:15 UTC (permalink / raw)
  To: Luciano Rocha; +Cc: git

This was discussed to death.  Check the list archive.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 19:58 rev-parse doesn't take pwd into consideration Luciano Rocha
  2008-05-26 20:15 ` Junio C Hamano
@ 2008-05-26 20:18 ` Teemu Likonen
  2008-05-26 20:52   ` Luciano Rocha
  2008-05-26 21:35 ` しらいしななこ
  2 siblings, 1 reply; 11+ messages in thread
From: Teemu Likonen @ 2008-05-26 20:18 UTC (permalink / raw)
  To: Luciano Rocha; +Cc: git

Luciano Rocha wrote (2008-05-26 20:58 +0100):

> Is it difficult to make rev-parse accept relative path specifications?

I don't know but let's consider this: The revision user is asking for
with "git show <commit>:<path>" may not even contain the directory user
is currently in. Also, there may not be any working directory at all, or
user may be completely outside the repository and using "git
--git-dir=/somewhere/else". I guess the system is much simpler as the
"<commit>:" always refers to repository's root.

If you are using Git's bash completions it's easy to complete paths with
"git show <commit>:". For example, try

  $ git show HEAD~10:Docum<tab>

and the path is completed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 20:18 ` Teemu Likonen
@ 2008-05-26 20:52   ` Luciano Rocha
  0 siblings, 0 replies; 11+ messages in thread
From: Luciano Rocha @ 2008-05-26 20:52 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

On Mon, May 26, 2008 at 11:18:42PM +0300, Teemu Likonen wrote:
> Luciano Rocha wrote (2008-05-26 20:58 +0100):
> 
> > Is it difficult to make rev-parse accept relative path specifications?
> 
> I don't know but let's consider this: The revision user is asking for
> with "git show <commit>:<path>" may not even contain the directory user
> is currently in. Also, there may not be any working directory at all, or
> user may be completely outside the repository and using "git
> --git-dir=/somewhere/else". I guess the system is much simpler as the
> "<commit>:" always refers to repository's root.

If <commit>:<path> is valid assuming the repository's root, then use it.
If it isn't, try <commit>:<path_to_git_root>/<path>.

> If you are using Git's bash completions it's easy to complete paths with
> "git show <commit>:". For example, try

I find bash-completion more an hassle than useful, thanks anyway.

>   $ git show HEAD~10:Docum<tab>
> 
> and the path is completed.

But a user usually thinks relative to the current directory, not to the
project's root.

But I should check the archives before any further discussion, as Junio
C Hamano observed.

Thanks for your input.

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 19:58 rev-parse doesn't take pwd into consideration Luciano Rocha
  2008-05-26 20:15 ` Junio C Hamano
  2008-05-26 20:18 ` Teemu Likonen
@ 2008-05-26 21:35 ` しらいしななこ
  2008-05-26 21:44   ` Johannes Schindelin
                     ` (4 more replies)
  2 siblings, 5 replies; 11+ messages in thread
From: しらいしななこ @ 2008-05-26 21:35 UTC (permalink / raw)
  To: gitster; +Cc: Luciano Rocha, git

Quoting Junio C Hamano <gitster@pobox.com> writes:

> This was discussed to death.  Check the list archive.

Junio, sometimes I think you are being very mean.  I am reasonably sure you meant this one, but why didn't you give a pointer for him?

http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68852

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

----------------------------------------------------------------------
Get a free email address with REAL anti-spam protection.
http://www.bluebottle.com/tag/1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 20:15 ` Junio C Hamano
@ 2008-05-26 21:42   ` Johannes Schindelin
  0 siblings, 0 replies; 11+ messages in thread
From: Johannes Schindelin @ 2008-05-26 21:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Luciano Rocha, git

Hi,

On Mon, 26 May 2008, Junio C Hamano wrote:

> This was discussed to death.  Check the list archive.

FWIW I have a patch in my personal fork that allows "git show HEAD:./bla":

http://repo.or.cz/w/git/dscho.git?a=commitdiff;h=3007b5c53d9b571f992f3e2d801248ff0bd15c76

If you like the patch, you are free to push for inclusion; I do not need 
it myself, and wasted enough time in writing it, so I will not waste any 
more time with it.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 21:35 ` しらいしななこ
@ 2008-05-26 21:44   ` Johannes Schindelin
  2008-05-26 21:48   ` Junio C Hamano
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Johannes Schindelin @ 2008-05-26 21:44 UTC (permalink / raw)
  To: しらいしななこ
  Cc: gitster, Luciano Rocha, git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 750 bytes --]

Hi,

On Tue, 27 May 2008, しらいしななこ wrote:

> Quoting Junio C Hamano <gitster@pobox.com> writes:
> 
> > This was discussed to death.  Check the list archive.
> 
> Junio, sometimes I think you are being very mean.  I am reasonably sure 
> you meant this one, but why didn't you give a pointer for him?
> 
> http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68852

Note that it takes a little bit of time for every such request to find the 
pointer.  A little bit of time times a many times makes quite some time.

I think it is _not_ asking too much to expect people to do _basic_ 
research.

And yes, searching the mailing list (if a simple Google search is not 
enough) _does_ qualify for "basic research".

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 21:35 ` しらいしななこ
  2008-05-26 21:44   ` Johannes Schindelin
@ 2008-05-26 21:48   ` Junio C Hamano
  2008-05-26 22:14   ` Luciano Rocha
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2008-05-26 21:48 UTC (permalink / raw)
  To: しらいしななこ
  Cc: Luciano Rocha, git

しらいしななこ  <nanako3@bluebottle.com> writes:

> Quoting Junio C Hamano <gitster@pobox.com> writes:
>
>> This was discussed to death.  Check the list archive.
>
> Junio, sometimes I think you are being very mean.  I am reasonably sure you meant this one, but why didn't you give a pointer for him?

Well, because my response roughly translates to "Your lack of research
before posting would have wasted other's time, don't do it", I _could_
have spent some time researching before posting to keep Luciano from
spending his time on going back to the list archive.  Setting a good
example, so to speak.

In that sense, perhaps you may have a point.

But I do not think I (or we collectively as the project) can afford to
keep doing that in the longer term.  A minute lost for me is a minute lost
for the project to review and integrate changes that others spent dozens
of minutes, perhaps hours, to come up with.  So I should not be constantly
doing the archive research for other people.

My response might have been mean, and I instead could have ignored it and
allow the thread to waste time of others responding to it, but that would
have been a worse alternative than nipping it off in the bud.  I am not
sure what better alternatives there were, other than having a dedicated
secretary/librarian to do the archive research for the community.

> http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68852

Yeah, that's the one I had in mind.  I like quoting the threaded interface
from gmane --- it makes the context of old discussion very clear.

Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 21:35 ` しらいしななこ
  2008-05-26 21:44   ` Johannes Schindelin
  2008-05-26 21:48   ` Junio C Hamano
@ 2008-05-26 22:14   ` Luciano Rocha
  2008-05-26 23:14   ` Luciano Rocha
  2008-05-27 10:53   ` しらいしななこ
  4 siblings, 0 replies; 11+ messages in thread
From: Luciano Rocha @ 2008-05-26 22:14 UTC (permalink / raw)
  To: しらいしななこ; +Cc: gitster, git

[-- Attachment #1: Type: text/plain, Size: 563 bytes --]

On Tue, May 27, 2008 at 06:35:10AM +0900, しらいしななこ wrote:
> Quoting Junio C Hamano <gitster@pobox.com> writes:
> 
> > This was discussed to death.  Check the list archive.
> 
> Junio, sometimes I think you are being very mean.  I am reasonably sure you meant this one, but why didn't you give a pointer for him?
> 
> http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68852

Thanks for the pointer.

Regards,
Luciano Rocha

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 21:35 ` しらいしななこ
                     ` (2 preceding siblings ...)
  2008-05-26 22:14   ` Luciano Rocha
@ 2008-05-26 23:14   ` Luciano Rocha
  2008-05-27 10:53   ` しらいしななこ
  4 siblings, 0 replies; 11+ messages in thread
From: Luciano Rocha @ 2008-05-26 23:14 UTC (permalink / raw)
  To: しらいしななこ; +Cc: gitster, git

[-- Attachment #1: Type: text/plain, Size: 776 bytes --]

On Tue, May 27, 2008 at 06:35:10AM +0900, しらいしななこ wrote:
> Quoting Junio C Hamano <gitster@pobox.com> writes:
> 
> > This was discussed to death.  Check the list archive.
> 
> Junio, sometimes I think you are being very mean.  I am reasonably sure you meant this one, but why didn't you give a pointer for him?
> 
> http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68852

Well, that clears things up. Thanks again.

I've thought of changing only the git-show command, but I've since
realized that it will imply changing critical code used by every
command.

So I'll be content with git-showrel. :)

Best regards,
Luciano Rocha

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rev-parse doesn't take pwd into consideration
  2008-05-26 21:35 ` しらいしななこ
                     ` (3 preceding siblings ...)
  2008-05-26 23:14   ` Luciano Rocha
@ 2008-05-27 10:53   ` しらいしななこ
  4 siblings, 0 replies; 11+ messages in thread
From: しらいしななこ @ 2008-05-27 10:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Luciano Rocha, git

Quoting Junio C Hamano <gitster@pobox.com>:

> But I do not think I (or we collectively as the project) can afford to
> keep doing that in the longer term.  A minute lost for me is a minute lost
> for the project to review and integrate changes that others spent dozens
> of minutes, perhaps hours, to come up with.  So I should not be constantly
> doing the archive research for other people.

I agree that your time is more valuable.

> My response might have been mean, and I instead could have ignored it and
> allow the thread to waste time of others responding to it, but that would
> have been a worse alternative than nipping it off in the bud.  I am not
> sure what better alternatives there were, other than having a dedicated
> secretary/librarian to do the archive research for the community.
>
>> http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68852
>
> Yeah, that's the one I had in mind.  I like quoting the threaded interface
> from gmane --- it makes the context of old discussion very clear.

I remembered that you were not so happy when I pointed at marc.info the last time.  I can learn (^_^).

And it was very easy to find the discussion in gmane (I asked "relative cwd path blob" and the discussion was the first in the list).

> Thanks.

You are wellcome (^_^).

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

----------------------------------------------------------------------
Free pop3 email with a spam filter.
http://www.bluebottle.com/tag/5

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-05-27 10:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-26 19:58 rev-parse doesn't take pwd into consideration Luciano Rocha
2008-05-26 20:15 ` Junio C Hamano
2008-05-26 21:42   ` Johannes Schindelin
2008-05-26 20:18 ` Teemu Likonen
2008-05-26 20:52   ` Luciano Rocha
2008-05-26 21:35 ` しらいしななこ
2008-05-26 21:44   ` Johannes Schindelin
2008-05-26 21:48   ` Junio C Hamano
2008-05-26 22:14   ` Luciano Rocha
2008-05-26 23:14   ` Luciano Rocha
2008-05-27 10:53   ` しらいしななこ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).