[LLVMdev] git

Matthieu Moy Matthieu.Moy at grenoble-inp.fr
Sat Jul 23 04:34:40 PDT 2011

Chris Lattner <clattner at apple.com> writes:

> I really do appreciate distributed VCS, but only as staging.
> Incremental development is crucial for the project and "take this git
> push with 100K of code" will never be acceptable.

Incremental development is probably promoted by DVCS far more than
others. Your comment seems to imply that only the tip of each push is
important. In the Git world, it usually isn't.

The flow promoted by Git is precisely to make sure each and every commit
passes the tests. So, the granularity of "incremental development" is
really the commit, not how often you merge.

"git bissect" is a good illustration of this. It does not only bissect
accross the mainline, but it does all along the DAG. For example, if you
bisect a regression between linux-2.6.38 and linux-2.6.39, you may well
end up with a guilty commit that was written long before linux-2.6.38,
but merged in the window between 2.6.38 and 2.6.39.

In a world where only merges are important, it's acceptable to have a
history like

merge feature A
  +- start feature A
  +- oops, typo
  +- oops, forgot a svn add
  +- continue feature A
  +- oops, another fix in first commit
merge feature B

With Git's best practice, you may have such history locally, but you
should not push it as it is. You usually rework your history (things
like "git rebase -i" are just great for that) to clean it up, and then
have it accepted by upstream. Ideally, you make sur the testsuite passes
for each commit before pushing.

If you like incremental development, you're going to love DVCS.

Matthieu Moy

More information about the llvm-dev mailing list