All of lore.kernel.org
 help / color / mirror / Atom feed
* Can you git clone -partial? I am looking to make a mobile app and it would be nice to have.
@ 2014-10-01 16:51 James Hancock
  2014-10-01 17:38 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: James Hancock @ 2014-10-01 16:51 UTC (permalink / raw)
  To: git

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

I guess you would need to keep the projects .git in order to maintain
consistency, or would you? I'm going to do some more research about
what .git does exactly.

Cheers,
James

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can you git clone -partial? I am looking to make a mobile app and it would be nice to have.
  2014-10-01 16:51 Can you git clone -partial? I am looking to make a mobile app and it would be nice to have James Hancock
@ 2014-10-01 17:38 ` Junio C Hamano
  2014-10-01 21:32   ` James Hancock
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2014-10-01 17:38 UTC (permalink / raw)
  To: James Hancock; +Cc: git

James Hancock <james@bookstobrains.com> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can you git clone -partial? I am looking to make a mobile app and it would be nice to have.
  2014-10-01 17:38 ` Junio C Hamano
@ 2014-10-01 21:32   ` James Hancock
  0 siblings, 0 replies; 3+ messages in thread
From: James Hancock @ 2014-10-01 21:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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@pobox.com> wrote:
> James Hancock <james@bookstobrains.com> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-01 21:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 16:51 Can you git clone -partial? I am looking to make a mobile app and it would be nice to have James Hancock
2014-10-01 17:38 ` Junio C Hamano
2014-10-01 21:32   ` James Hancock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.