git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: <eero.aaltonen@vaisala.com>
To: <jonathantanmy@google.com>
Cc: <git@vger.kernel.org>
Subject: Re: Behavior of 'git fetch' for commit hashes
Date: Tue, 20 Jun 2017 11:32:48 +0000	[thread overview]
Message-ID: <be81c12a-75b1-386b-d075-f92ee72ddfce@vaisala.com> (raw)
In-Reply-To: <20170619152658.4559bce4@twelve2.svl.corp.google.com>

On 20.06.2017 01:26, Jonathan Tan wrote:
> On Mon, 19 Jun 2017 10:49:36 -0700
> Jonathan Tan <jonathantanmy@google.com> wrote:
> 
>> On Mon, 19 Jun 2017 12:09:28 +0000
>> <eero.aaltonen@vaisala.com> wrote:
>>
>>> For version 2.13.3
> 
> Firstly, exactly which version of Git doesn't work? I'm assuming 2.13.1
> (as written elsewhere in your e-mail), since 2.13.3 doesn't exist.

Yes. 2.13.1. I should stick to copy-pasting.

> I tried to reproduce with this script, but it seems to pass even at
> 2.13.1:
> 
>     #!/bin/bash
>     rm -rf ~/tmp/x &&
>     make --quiet &&
>     ./git init ~/tmp/x &&
>     ./git -C ~/tmp/x fetch --quiet ~/gitpristine/git master:foo &&
>     ./git -C ~/tmp/x fetch ~/gitpristine/git "$(git -C ~/gitpristine/git rev-parse master^)"
>     exit $?
> 
> Commenting out the first fetch line produces, as expected:
> 
>     error: Server does not allow request for unadvertised object <hash>
> 
> And I have not seen the "fatal: Couldn't find remote ref" error you
> describe.

I am now getting the same "unadvertised object" error. The "remote ref"
error it seems was due to missing the last character of the SHA1 :/

Now with that resolved, the "fetch branch; fetch commit" also works just
as before.

> I'll take a look into the expected behavior, but if my assumptions are
> correct, you should be able to just checkout the commit you want after
> fetching the branch:
> 
>   git fetch <forkUrl> <branch>
>   git checkout <sha1>

This actually produces
fatal: reference is not a tree: <sha1>

But I can use the above dual fetch. Seems this problem was more between
the keyboard and chair. I am however glad to hear that literal SHA1s are
becoming fetchable.

Thanks for investigating,
-- 
Eero Aaltonen

      reply	other threads:[~2017-06-20 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 12:09 Behavior of 'git fetch' for commit hashes eero.aaltonen
2017-06-19 15:50 ` Stefan Beller
2017-06-19 17:49 ` Jonathan Tan
2017-06-19 22:26   ` Jonathan Tan
2017-06-20 11:32     ` eero.aaltonen [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=be81c12a-75b1-386b-d075-f92ee72ddfce@vaisala.com \
    --to=eero.aaltonen@vaisala.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).