git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@ucw.cz>
To: "Sparks, Sam" <SSparks@twacs.com>
Cc: git@vger.kernel.org
Subject: Re: Git'ing a non-labeled set of sources
Date: Thu, 9 Aug 2007 22:02:18 +0200	[thread overview]
Message-ID: <20070809200218.GA4567@efreet.light.src> (raw)
In-Reply-To: <CF7E46FCFF66AD478BB72724345289EC170CE4@twx-exch01.twacs.local>

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

On Wed, Aug 08, 2007 at 13:59:38 -0500, Sparks, Sam wrote:
> Hello All,
> 
> Please excuse me if this is an ignorant question; I'm new to git and my
> have overlooked something in the documentation.
> 
> I'm attempting to obtain a snapshot of source code from an unlabeled git
> branch in a public repository. I've found in the documentation that a
> timestamp cannot be used to specify a particular version of source code,
> but I believe I can work with the commit value as returned by 'git
> show'.

Clone and pull, over git protocol, only ask the server for objects referenced
by any refs -- plus all objects those depend on. Which does not necessarily
mean all commits, because references may be removed.

If a branch (ie. ref in refs/heads) is removed or rewound (moved to point to
commit that is not descendant of what it pointed to before), some commits may
become dangling. Clone and pull won't know such commits exist and therefore
won't be able to ask server to provide them.

> However, I have been unsuccessful in my attempts to use this identifier
> to clone or checkout the associated source tree. Has anyone been
> successful in using git to successfully replicate an unlabeled version
> of sources in a repository?
> 
> Here is my latest attempt:
> /dir_i_want_to_replicate $ git show --pretty=short
> commit 5b1313fb2758ffce8b624457f777d8cc6709608d
> Author: ....

I bet that if you do 'git lost-found' here, it will find something and this
commit will be among the finds, or predecessor of one of them.

> /replication_dir $ git clone git://www.denx.de/git/u-boot.git
> u-boot-mpc83xx
> Blah blah blah..
>  100% (4378/4378) done
> /replication_dir/u-boot-mpc83xx/ $ git checkout
> 5b1313fb2758ffce8b624457f777d8cc6709608d
> error: pathspec '5b1313fb2758ffce8b624457f777d8cc6709608d' did not match
> any. 

It seems that git pull only accepts refs as arguments. So you'll have to
create a branch at that commit in the origin to get it over to destination.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

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

      parent reply	other threads:[~2007-08-09 20:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08 18:59 Git'ing a non-labeled set of sources Sparks, Sam
2007-08-08 19:37 ` Peter Baumann
2007-08-08 19:52   ` Sparks, Sam
2007-08-08 20:17     ` Peter Baumann
2007-08-08 20:45       ` Sparks, Sam
2007-08-08 20:59         ` Sparks, Sam
2007-08-08 21:20     ` Alex Riesen
2007-08-09 20:02 ` Jan Hudec [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

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

  git send-email \
    --in-reply-to=20070809200218.GA4567@efreet.light.src \
    --to=bulb@ucw.cz \
    --cc=SSparks@twacs.com \
    --cc=git@vger.kernel.org \
    /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.
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).