public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail•com>
To: Jeff King <peff@peff•net>
Cc: Dan Johnson <computerdruid@gmail•com>,
	Christian Halstrick <christian.halstrick@gmail•com>,
	Git <git@vger•kernel.org>
Subject: Re: Can I fetch an arbitrary commit by sha1?
Date: Thu, 2 Oct 2014 10:35:51 -0700	[thread overview]
Message-ID: <20141002173551.GA12591@google.com> (raw)
In-Reply-To: <20141002161006.GB2505@peff.net>

Jeff King wrote:

> But I think Christian is arguing that the client side should complain
> that $sha1 is not a remote ref, and therefore not something we can
> fetch.  This used to be the behavior until 6e7b66e (fetch: fetch objects
> by their exact SHA-1 object names, 2013-01-29). The idea there is that
> some refs may be kept "hidden" from the ref advertisement, but clients
> who learn about the sha1 out-of-band may fetch the tips of hidden refs.
>
> I'm not sure it is a feature that has been particularly well-used to
> date, though.

I use it pretty often.  The commits I'm fetching are pointed to
directly by refs, but I don't care about what the ref is called and I
want exactly that commit.

The context is that the commit is mentioned in the gerrit web UI.
Fetching by commit name feels simpler than getting the
refs/changes/something ref, since I think in terms of commits instead
of in terms of change numbers.

Thanks and hope that helps,
Jonathan

  reply	other threads:[~2014-10-02 17:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 13:57 Can I fetch an arbitrary commit by sha1? Christian Halstrick
2014-10-02 14:22 ` Dan Johnson
2014-10-02 16:10   ` Jeff King
2014-10-02 17:35     ` Jonathan Nieder [this message]
2014-10-05 20:49       ` Christian Halstrick
2014-10-06 18:25     ` Patrick Donnelly
2014-10-06 18:28       ` David Lang
2014-10-07 12:34       ` Duy Nguyen
2014-10-07 13:12         ` Duy Nguyen
2014-10-07 16:52           ` Junio C Hamano
2014-10-08 13:30             ` Duy Nguyen
2014-10-09 18:08               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141002173551.GA12591@google.com \
    --to=jrnieder@gmail$(echo .)com \
    --cc=christian.halstrick@gmail$(echo .)com \
    --cc=computerdruid@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox