Re: Can you git clone -partial? I am looking to make a mobile app and it would be nice to have.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I see what you are saying with the file thing. I am not a git master
and I am afraid that is showing in the words I use...

The app I want to build is actually part of testing a Mobile Markdown
Editor I am working on. I thought a good way to prove the system would
be to make a simple app that allows you to edit your READMEs and other
Markdown pages in your projects that use Git. They could be hosted on
Github or elsewhere. It is mostly about testing the editor
functionality on a larger scale.

So, I want to just get the files I need out of the collection of file
history and then put it back when and if I need to. But, I want to do
this with as little network and data storage as possible (given the
limitations of a mobile environment). I know most projects aren't very
large as far as file size goes, but I am still wondering at what it
would take to do this and if Git has the ability, or what would need
to change for it to have the ability. Maybe it isn't worth it? I just
want to be able to say why it isn't worth it with good reason.

I read about git archive and I looks like it almost does what I want.
I am not sure what happens underlying so my Git Noobness will show
again here. I found documentation on how to us archive but I haven't
been able to find something that tells me how archive does what it
does.

1) Can you the push your changes in a file that you have used git
archive for? Maybe you can do it just to set up a pull request or
something.

2) How would the archive know when to pull updated changes? My
understanding is that archive would just pull out the file but it
would then be separated from its' parent. Is there a cost effective
way to compare the archive to the master without downloading the whole
history? Maybe I could keep a record of where the repo is and just
have the program check the original repo for a new version?

3) I am wondering how intensive archive is? Do you need to get
everything and then it narrow it down on your end or do you just grab
the small part you need? How does the repo know what to give you? It
says it compresses the data. Where does the compression happen?


Cheers,
James

On Thu, Oct 2, 2014 at 1:38 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> James Hancock <james@xxxxxxxxxxxxxxxxx> writes:
>
>> i am thinking about developing an app and I want to integrate it with
>> git but I only want to store a portion of the file on disk. It is
>> going to be in a mobile enviornment and I want to just get one file or
>> a small group of files.
>>
>> I read that you can clone and then only look at one peice but is it
>> possible just to clone one peice? And if not what would it take? Maybe
>> this is a feature people would like to have. Just hypothetically, what
>> would need to happen?
>>
>> Either
>> git clonepartial /repo /file/or/folder/in/repo
>> Or
>> Git clone -partial /repo /file/or/folder/in/repo
>
> You keep saying "file", but the thing is, Git does not track file.
> It tracks history of collection of files.
>
> What are you trying to achieve, exactly?  What does your "app" need
> out of that operation?  Does it need these selected files with their
> history?  Or does it only care about the contents of the selected
> files at the tip of the 'master' branch of that repository?
>
> I'd imagine that your answer would be the latter, and suspect that
> you may want to run "git archive --remote" with a pathspec to limit
> what gets grabbed.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]