Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Checking out a single file

Hi,

I suggest this can be solved by teaching DirCacheCheckout to accept
filters for the treewalk. Then we could set a filter which matches
only those paths you are interested in. That's only a small addition
and we anyhow need filters to implement things like 'git checkout
<commit> -- <paths>'

Ciao
  Chris



On Mon, Nov 29, 2010 at 14:48, Remy Suen <remysuen@xxxxxxxxxx> wrote:
> On Fri, Nov 26, 2010 at 8:23 AM, Lluis Sanchez Gual <slluis.devel@xxxxxxxxx>
> wrote:
>> I want to check out a single file from a commit. DirCacheCheckout does
>> what I want, but it operates on the whole tree. How can I do the same
>> but for a single file?
>
> I was able to take stuff from the index by copy/pasting most of the code
> from DirCacheCheckout's static checkoutEntry(*) method and then asking the
> DirCacheBuilder to keep all of its existing entries.
>
> Not sure if that's necessarily of use to you or not though as it seems like
> what you want is slightly more complicated than what I was trying to achieve
> (just take from index instead of taking from a specific commit).
>
> Regards,
> Remy
>
> ----------
> Remy Suen
> Eclipse Platform/UI Committer
> IBM Ottawa
> 1-613-356-5162
>
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jgit-dev
>
>


Back to the top