From: Eli Barzilay <eli@barzilay.org>
To: git@vger.kernel.org
Subject: Re: Checking out on a different+partial directory
Date: Thu, 27 May 2010 01:10:12 -0400 [thread overview]
Message-ID: <m3d3wikk0b.fsf@winooski.ccs.neu.edu> (raw)
In-Reply-To: 20100522054852.GB29118@coredump.intra.peff.net
Jeff King <peff@peff.net> writes:
> On Mon, May 17, 2010 at 06:53:55AM -0400, Eli Barzilay wrote:
>
>> Say that I have a repository at /some/dir, and a tree that contains
>> most of its files at /another/dir (the second is a build directory,
>> made with `git archive', so some files removed due to export-ignore
>> attributes and some built files are present).
>>
>> Is there a convenient way to make /some/dir usable as a repository?
>
> Did you mean /another/dir? /some/dir is already a repository as per your
> description above
Yes, sorry for the confusion...
> (is it a bare repository or a regular one?).
It's a regular one.
>> Two things that I tried are
>>
>> git --work-tree=/another/dir reset --hard master
>>
>> which one time, but then failed with "fatal: unable to read tree...",
>> and another is
>
> I would have thought that worked, assuming you were in /some/dir. And
> oddly, _some_ stuff works. I tried:
>
> [...]
>
> So there is clearly a bug. I'll investigate.
Thanks!
>> cp -a /some/dir/.git /another/dir
>> cd /another/dir
>> git reset --hard master
>>
>> which looks like it can suffer from the same problem.
>
> That should work, too.
Heh, I just assumed that I'm doing something similarly wrong in both
cases... In any case, I finally settled on doing things the other
way: grab all of the files that were created by the built tree and add
them to the repository directory (that is -- get stuff from
/another/dir into /some/dir). It's a little less convenient for me,
so I'll probably switch back to the above, given that it should work.
>> (It would be especially nice if there's a way to have only
>> different files touched in /another/dir.)
>
> Only different files will be rewritten, but git will have to read all of
> the files to determine their sha1 (usually it avoids this by checking
> stat info, but obviously your exported files will not match the stat
> info in the /another/dir's index).
Yes, I expected this cost...
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!
prev parent reply other threads:[~2010-05-27 5:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-17 10:53 Checking out on a different+partial directory Eli Barzilay
2010-05-22 5:48 ` Jeff King
2010-05-22 6:43 ` [PATCH] fix over-eager caching in sha1_file_name Jeff King
2010-05-22 6:59 ` [PATCH] remove " Jeff King
2010-05-26 5:07 ` Junio C Hamano
2010-05-27 5:10 ` Eli Barzilay [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=m3d3wikk0b.fsf@winooski.ccs.neu.edu \
--to=eli@barzilay.org \
--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).