git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Fetching commit instead of ref
@ 2017-12-18 12:30 Carlsson, Magnus
  2017-12-18 18:16 ` Jonathan Tan
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Carlsson, Magnus @ 2017-12-18 12:30 UTC (permalink / raw)
  To: git@vger.kernel.org

Hi

I am involved in the git-subrepo project (https://github.com/ingydotnet/git-subrepo/). It's an attempt to simplify the inclusion of repos into other repos.

In a certain situation I would really need to fetch all commits related to a specific commit (SHA). I have read the git fetch documentation and found nothing regarding this. It only seems to support fetching references.

I found some traces on stack overflow:
https://stackoverflow.com/questions/14872486/retrieve-specific-commit-from-a-remote-git-repository

Following that recommendation it feels like it almost works:
$ git fetch subrepo 50f730db793e0733b159326c5a3e78fd48cedfec:refs/remote/subrepo/foo-commit
remote: Counting objects: 2311, done.
remote: Total 2311 (delta 0), reused 0 (delta 0), pack-reused 2311
Receiving objects: 100% (2311/2311), 703.64 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1174/1174), done.
----> So far so good, but then an error message appear:
error: Server does not allow request for unadvertised object 50f730db793e0733b159326c5a3e78fd48cedfec
----> And nothing seems to be fetched.

Is there a way to fetch a commit and any ancestors to that commit based on a SHA?

Why do I need this?
In git-subrepo we try to recreate another repo within our main repo. Creating the necessary parent references when they appear. In some cases we need to make sure that we have access to the correct commits from the subrepo, but we don't have any references except a SHA.
 
-- Magnus
 
 
MAGNUS CARLSSON
 Staff Software Engineer
 ARRIS
 
 o: +46 13 36 75 92
 e: magnus.carlsson@arris.com
 w: www.arris.com
 
 ARRIS:  Legal entity: Arris Sweden AB - Registered Office: Teknikringen 2, 583 30 Linkoping, Sweden - Reg No:556518-5831 - VAT No:SE 556518-583
 
 This electronic transmission (and any attached document) is for the sole use of the individual or entity to whom it is addressed.  It is confidential and may be attorney-client privileged.  In any event the Sender reserves, to the fullest extent, any "legal  advice privilege".  Any further distribution or copying of this message is strictly prohibited.  If you received this message in error, please notify the Sender immediately and destroy the attached message (and all attached documents).
      

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

end of thread, other threads:[~2017-12-22 18:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18 12:30 Fetching commit instead of ref Carlsson, Magnus
2017-12-18 18:16 ` Jonathan Tan
2017-12-18 18:22 ` Stefan Beller
2017-12-18 18:44 ` Junio C Hamano
2017-12-19  8:41   ` Carlsson, Magnus
2017-12-19 16:07     ` Junio C Hamano
2017-12-20  7:48       ` Carlsson, Magnus
2017-12-22 18:47         ` Junio C Hamano

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).