From: Rogan Dawes <lists@dawes.za.net>
To: Jakub Narebski <jnareb@gmail.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
Filippo Zangheri <filippo.zangheri@yahoo.it>,
git@vger.kernel.org
Subject: Re: [QUESTION] Selective fetch possible?
Date: Tue, 11 Mar 2008 03:26:20 -0400 [thread overview]
Message-ID: <47D6341C.7030505@dawes.za.net> (raw)
In-Reply-To: <m3d4q2ywyx.fsf@localhost.localdomain>
Jakub Narebski wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
>
>> Filippo Zangheri <filippo.zangheri@yahoo.it> wrote:
>>> Is it possible to git-fetch only a portion of the tree
>>> of the specified repository, say, fetch only one directory or a
>>> subset of files matching some regular expression? This is currently
>>> - to my knowledge - only possible via wget iff the GIT repository
>>> has gitweb enabled. But that's just a workaround.
>> No.
>>
>> You can use a shallow clone to fetch only X commits back into
>> history on any branch, and you can also manually configure the
>> fetch specification in .git/config to only fetch specific branches,
>> but you must fetch the entire tree to get any of the files in it.
>>
>> If the repository is available by git:// protocol you may be able
>> to use git-archive to obtain a tarfile for just the directory you
>> want (service has to be enabled on the remote side) but that is
>> just a raw UNIX tar; there is no Git repository and no ability to
>> commit/fetch/push/diff/apply/log/etc.
>
> Note that what you wanted is, I guess, something called partial
> checkout or subtree checkout. This feature appears now and then in
> feature requests; lately Nguyen Thai Ngoc Duy (pclouds) offered to do
> this in "on subtree checkout" thread:
> http://thread.gmane.org/gmane.comp.version-control.git/74915
I still believe that it could be done fairly easily by simply recording
the SHA1's of the files and directories that are *not* checked out
somewhere in the .git directory, and just reusing those when checking
the working tree. i.e. rather than stat-ing a tree that was never
checked out, get the known SHA1 for that tree from where it was recorded
on checkout.
> The problem is twofold, as far as I understand it. First, what to do
> if there is merge conflicts outside checked out (selected) directory?
This is something that has been repeated many times, and I fail to see
how it can be an issue. How can there be a conflict in a directory that
is not, and never has been, checked out, and therefore cannot have been
modified?
The only possibility that I can see is if the directory has been renamed
elsewhere, but in that case, it *is* effectively checked out (just with
a different directory name).
> Second, how to make repository contain only relevant objects: git in
> many places assumes full connectivity, and that if it has an object it
> hass all objects depending on it.
>
Yes, this is the big problem as I see it.
Rogan
next prev parent reply other threads:[~2008-03-11 7:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-10 22:02 [QUESTION] Selective fetch possible? Filippo Zangheri
2008-03-10 22:53 ` Shawn O. Pearce
2008-03-10 23:34 ` Jakub Narebski
2008-03-11 7:26 ` Rogan Dawes [this message]
2008-03-11 7:50 ` Shawn O. Pearce
2008-03-11 9:07 ` Rogan Dawes
2008-03-11 12:29 ` Filippo Zangheri
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=47D6341C.7030505@dawes.za.net \
--to=lists@dawes.za.net \
--cc=filippo.zangheri@yahoo.it \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=spearce@spearce.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.
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).