git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Urlichs <matthias@urlichs.de>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Shallow clones with explicit history cutoff?
Date: Fri, 22 Aug 2014 16:46:45 +0200	[thread overview]
Message-ID: <20140822144645.GS2049@smurf.noris.de> (raw)
In-Reply-To: <CACsJy8CSCcaFNxqqBLAnb5NXkwT+wVXCVmB8uF3RYwqRmz4tuw@mail.gmail.com>

Hi,

Duy Nguyen:
> On Thu, Aug 21, 2014 at 10:39 PM, Matthias Urlichs <matthias@urlichs.de> wrote:
> > What I would like to have, instead, is a version of shallow cloning which
> > cuts off not at a pre-determined depth, but at a given branch (or set of
> > branches). In other words, given
> >
> >             +-J--K  (packaged)
> >            /    /
> >   +-F--G--H----I    (clean)
> >  /       /
> > A---B---C---D---E   (upstream)
> >
> > a command "git clone --shallow-until upstream $REPO" (or however that would
> > be named) would create a shallow git archive which contains branches
> > packaged+clean, with commits FGHIJK. In contrast, with --single-branch and
> > --depth 4 I would get CGHIJK, which isn't what I'd want.
> 
> I would imagine a more generic mechanism "git clone
> --shallow-rev=<rev> $REPO" where you could pass anything that "git
> rev-list" can accept (maybe more restricted, and some verification
> required). --shallow-rev could be repeated. So in your case it could
> be "git clone --shallow-rev="^A" $REPO".

Umm, no. ^E (or ^upstream) would do what I want. Hopefully. ;-)

But you're right, that would fit far better into the existing git
paradigms.

> > As I have not spent too much time with the git sources lately (as in "None
> > at all"), some pointers where to start implementing this would be
> > appreciated, assuming (a) this has a reasonable chance of landing in git and
> > (b) nobody beats me to it. ;-)
> 
> I'd like to see this implemented. You are not the first one
> complaining about the (lack of) flexibility of --depth. If you have
> time, I may be able to support (I should not take on another topic
> given my many ongoing/unfinished topics).

Welcome to the club. :-/

Thanks for the pointers. I'll see what I can do (and when).

-- 
-- Matthias Urlichs

      reply	other threads:[~2014-08-22 15:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 15:39 Shallow clones with explicit history cutoff? Matthias Urlichs
2014-08-22 13:27 ` Duy Nguyen
2014-08-22 14:46   ` Matthias Urlichs [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=20140822144645.GS2049@smurf.noris.de \
    --to=matthias@urlichs.de \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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.
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).