tech-kern archive

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

Re: Slightly off topic, question about git





On Jun 6, 2022, at 2:00 AM, Brian Buhrow <buhrow%nfbcal.org@localhost> wrote:

    Hello.  At the risk of raising the debate about which version control system we should
use, I have a question about git, as well as a comment about it relative to the NetBSD source
tree.  I should preface my comments with the caveat that I am not by any means a git expert,
and, in fact, I'm barely able to get anything I want out of it.  With that said, here are my
questions and observations.  I'd be interested to know how others work around these issues
and/or what you think of my observations.

1.  In CVS, I can do something like:
cvs log sys/dev/pci/if_bge.c
and be given a complete history of the changes to that file, as well as a list of all the
branches that file participates in and which versions apply to each branch.  And, I can do this
without having to download all of the history of that file onto my local storage.
   It seems like the only way to do this with a git repository is to download the entire
source tree, along with its history and branches, using git clone with an infinite depth.  Is
this correct?  If not, how can I see all the branches of a given repository without having to
download the entire repository?


Look up git shallow clone and git sparse checkout (with options sparse index)

There is also a filtered clone and clone single branch.  


2.  Also, in my exploration of git, it seems like the git log command shows all the commits for
each tag, rather than the comments for a specific file or object in the repository.  Again, is
this correct?


git log -- file


   If I am correct in my guesses about how git works, it seems like I would have to download
the entire history of the NetBSD source tree if I want to browse its branches, or the commit
history for any given file.  This is a lot of overhead to examine tiny portions of the tree,
relatively speaking, assuming we move to git for our version control system.  It strikes me
that requiring this much storage space from developers, would be a regression from what we
currently do.  Since I think we're smarter than that and since we have very smart people on our
development team, I want to understand what it is that I don't get about git that precludes me

Read the docs I referred to above or emails from me in tech-repository or just ask these questions to your favorite search engine. 

https://git-scm.com/docs/git-clone


from having to download the entire history of the source tree from day one while still
retaining access to that history over time.

-thanks
-Brian



Your assumptions are incorrect.  Git is faster and can probably use even less space than a cvs checkout if you are smart about it. 


Home | Main Index | Thread Index | Old Index