User: Password:
|
|
Subscribe / Log in / New account

Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system

Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system

Posted Dec 20, 2012 17:09 UTC (Thu) by yarikoptic (subscriber, #36795)
In reply to: Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system by hummassa
Parent article: Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system

exactly -- I need some intrinsic knowledge of how many commits I need to fetch and then fetch all files touched by those, but the point is that I do not know how many commits, and I do not want to fetch anything irrelevant. I just need to

1. see what files are there NOW (after all GIT is a content tracking, right? ;-) )
2. what is the content of the file NOW, regardless when was it modified -- 1 commit back, or 1000 commits back

svn (and probably bzr, according to the blog -- I never used those features myself) provide such functionality. I did need it a few times too. That is why was my comment


(Log in to post comments)

Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system

Posted Dec 20, 2012 17:20 UTC (Thu) by hummassa (subscriber, #307) [Link]

You are right, but I usually set up gitweb for those needs.

Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system

Posted Dec 20, 2012 18:13 UTC (Thu) by tuna (guest, #44480) [Link]

I thought that git does not have files, only changes?

Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system

Posted Dec 20, 2012 19:59 UTC (Thu) by jengelh (subscriber, #33263) [Link]

The other way around. Basically, Git stores complete objects rather than some delta thing. Creating some commit whose diff reads

diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
index 4bf3dc4..5508113 100644
[...]

will get you a .git/objects/55/0811365ac655c3b2d4f9183112e15ad0ae17ba. It is compressed, but it is still standalone/complete/non-deltified. You can nuke all other objects, and git show 550811365 should still succeed.

Deltified packs are a strap-on option (one that's enabled by default because of its usefulness) to the base design.

Vernooij: Bazaar-NG: 7 years of hacking on a distributed version control system

Posted Dec 20, 2012 19:30 UTC (Thu) by dlang (subscriber, #313) [Link]

umm, One of us is misunderstanding something

doing a

git clone --depth 20 server:git/repo

doesn't give you only the files that have changed in the last 20 commits, it gives you ALL the files in the project, as they existed (changed or not) for the last 20 commits

so if you only care about what the files are NOW you can do "--depth 1", no need to know when it changed.

If you want the last 20 changes of a file, and that file hasn't changed for the last 1000 commits, then you really do want the full history, because the file may not have changed 20 times since it was created


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds