git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Feedback outside of the user survey

From
CJChristian Jaeger <christian@jaeger.mine.nu>
Date
Oct 16, 2008, 20:32 UTC
Message-ID
<48F7A4F8.2080600@jaeger.mine.nu>
In-Reply-To
<2d460de70810160618u1803375aj913145a5060e5308@mail.gmail.com>
Richard Hartmann wrote:
Show 7 quoted lines
> On Thu, Oct 16, 2008 at 13:56, Garry Dolley <gdolley@arpnetworks.com> wrote:
>
>   
>> I know from an external point of view, it seems pulling a subdir
>> wouldn't be a big deal; but if you look at git internals, you start
>> to realize why it's an option that isn't on the table.
>>     

Hm, I don't see a fundamental technical problem which would prevent one from implementing the ability to checkout only a subdirectory into the working directory (i.e. to add options to Git to make it reflect the working directory as being a subdirectory of what is in Git's database). At this level I don't see anything inherently different from SVN--except maybe for directory renames: if someone else is renaming the directory you've checked out, what should happend with your checkout? Git's filebased rename tracking would just lead to everything vanishing from your checkout. I don't know what happens in SVN, maybe it keeps track of the directory rename and still sends you the changes of the directory you've checked out even if it has now a different name on the server?

Anyway, an unavoidable difference is that you have to always clone the whole Git *database*. With SVN the database stays on the server, with Git it is being cloned. Just as I expect SVN to need the whole database to be able to work (tracking renames across directories etc.), Git needs the whole database too. So implementing subdirectory workingdir checkouts wouldn't help reduce the bandwidth and storage necessary for getting at the database.

>
> That's my understanding as well. And you can simply branch
> out a subdir when you want to work on it.
>   
I guess what you are referring to is
 $ git clone git://foo.com/bar.git
 $ cd bar
 $ rm -rf *
 $ git checkout somesubdir

Now you've got only somesubdir/ below bar/. This solves the rename problem insofar, as somesubdir will just be renamed if someone else commits a "git mv somesubdir somethingelse" and you pull that change. But there's also another caveat: "git status" will of course report the other files as deleted, which is an accident waiting to happen when you next run "git commit -a".

(In any case, this is just thinking louder than I deserve, as there's no code at all in Git written by me.)

Christian.
Previous: Richard HartmannNext: Garry Dolley
Message 6 of 17 in “Feedback outside of the user survey”
  1. Richard HartmannOct 16, 2008
  2. Jeff KingOct 16, 2008
  3. Richard HartmannOct 16, 2008
  4. Garry DolleyOct 16, 2008
  5. Richard HartmannOct 16, 2008
  6. Christian JaegerOct 16, 2008
  7. Garry DolleyOct 18, 2008
  8. Christian JaegerOct 18, 2008
  9. Andreas EricssonOct 20, 2008
  10. Christian JaegerOct 20, 2008
  11. Andreas EricssonOct 20, 2008
  12. Christian JaegerOct 20, 2008
  13. Andreas EricssonOct 20, 2008
  14. Christian JaegerOct 20, 2008
  15. Christian JaegerOct 20, 2008
  16. Junio C HamanoOct 20, 2008
  17. Christian JaegerOct 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.