git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* show refs points to a commit
@ 2012-06-08 19:37 Ralf Thielow
  2012-06-08 19:47 ` Vincent van Ravesteijn
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Thielow @ 2012-06-08 19:37 UTC (permalink / raw)
  To: git

After playing around with submodules, I haven't
found a builtin way to show refs pointing to a
specified commit without using UNIX pipes.

Especially when you working with submodules, it
would be very helpful to know which refs
points to this commit in order to switch from
"detached HEAD" to the branch you can (maybe)
work with.

Or did I miss something?

Thanks

Ralf

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

* Re: show refs points to a commit
  2012-06-08 19:37 show refs points to a commit Ralf Thielow
@ 2012-06-08 19:47 ` Vincent van Ravesteijn
  2012-06-08 19:51   ` Ralf Thielow
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent van Ravesteijn @ 2012-06-08 19:47 UTC (permalink / raw)
  To: Ralf Thielow; +Cc: git

Op 8-6-2012 21:37, Ralf Thielow schreef:
> After playing around with submodules, I haven't
> found a builtin way to show refs pointing to a
> specified commit without using UNIX pipes.
>
> Especially when you working with submodules, it
> would be very helpful to know which refs
> points to this commit in order to switch from
> "detached HEAD" to the branch you can (maybe)
> work with.
>
> Or did I miss something?

Is this what you mean ?

$ git rev-parse master
f623ca1cae600e97cb0b38131fdd33e4fb669cf8
$ git name-rev f623ca1cae600
f623ca1cae600 master
$ git name-rev --refs=refs/heads/* f344333cd
f344333cd master~10

Vincent

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

* Re: show refs points to a commit
  2012-06-08 19:47 ` Vincent van Ravesteijn
@ 2012-06-08 19:51   ` Ralf Thielow
  2012-06-08 20:03     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Thielow @ 2012-06-08 19:51 UTC (permalink / raw)
  To: Vincent van Ravesteijn; +Cc: git

On Fri, Jun 8, 2012 at 9:47 PM, Vincent van Ravesteijn <vfr@lyx.org> wrote:
> Is this what you mean ?
>
> $ git rev-parse master
> f623ca1cae600e97cb0b38131fdd33e4fb669cf8
> $ git name-rev f623ca1cae600
> f623ca1cae600 master
> $ git name-rev --refs=refs/heads/* f344333cd
> f344333cd master~10
>

I just want to know what's the refs where
the *tip* points to my specified commit.

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

* Re: show refs points to a commit
  2012-06-08 19:51   ` Ralf Thielow
@ 2012-06-08 20:03     ` Junio C Hamano
  2012-06-08 20:10       ` Ralf Thielow
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-06-08 20:03 UTC (permalink / raw)
  To: Ralf Thielow; +Cc: Vincent van Ravesteijn, git

Ralf Thielow <ralf.thielow@googlemail.com> writes:

> On Fri, Jun 8, 2012 at 9:47 PM, Vincent van Ravesteijn <vfr@lyx.org> wrote:
>> Is this what you mean ?
>>
>> $ git rev-parse master
>> f623ca1cae600e97cb0b38131fdd33e4fb669cf8
>> $ git name-rev f623ca1cae600
>> f623ca1cae600 master
>> $ git name-rev --refs=refs/heads/* f344333cd
>> f344333cd master~10
>>
>
> I just want to know what's the refs where
> the *tip* points to my specified commit.

"git for-each-ref" gives the mapping from the tip of your refs to
object names.  We do not keep and give reverse mapping but there
should be enough information in for-each-refs output to get the
information yourself, I think.

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

* Re: show refs points to a commit
  2012-06-08 20:03     ` Junio C Hamano
@ 2012-06-08 20:10       ` Ralf Thielow
  0 siblings, 0 replies; 5+ messages in thread
From: Ralf Thielow @ 2012-06-08 20:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Vincent van Ravesteijn, git

> "git for-each-ref" gives the mapping from the tip of your refs to
> object names.  We do not keep and give reverse mapping but there
> should be enough information in for-each-refs output to get the
> information yourself, I think.

But you need to grep if you have a big list, don't you?
Michael H. points me to: "git log -1 --decorate"
which works very well to me.

Thanks

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

end of thread, other threads:[~2012-06-08 20:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-08 19:37 show refs points to a commit Ralf Thielow
2012-06-08 19:47 ` Vincent van Ravesteijn
2012-06-08 19:51   ` Ralf Thielow
2012-06-08 20:03     ` Junio C Hamano
2012-06-08 20:10       ` Ralf Thielow

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).