Live data from Hacker News

Hitting every branch on the way down

rachelbythebay.com

141–144 of 144 posts

Re: Hitting every branch on the way down

#141

Earlier quoted context omitted.

Well, yes - git log does have special handling of commits with multiple parents because everything it shows is a special cased lie. Why? Because commits do not contain diffs or patches, but are instead full snapshots of the repository as a whole at a point in time. git log -p is a convenience tool that tries to show code progression, and so it comes up with these simple diffs. Showing a graph of N-way conflict resolu…

What git log shows is not "a lie", it is a part of its data model. Git is all of its commands, not just the low level details. Commits are both snapshots of the entire repo, and diffs, and delta compressions - none of these is "a lie".

> Commits are both snapshots of the entire repo, and diffs, and delta compressions - none of these is "a lie".

Commits are never diffs. Commits are snapshots, and sometimes git computes a diff between two commits. Commits are also never delta compressions, but can be stored within a delta-compressed packfile.

Whether you like it or not, git is primarily its low level details. The porcelain stacked on top changes, and differs depending on the user's client (e.g., a GUI using libgit2). However, that "git log -p" is "part of git" that git log -p is not trying to convince you that commits are diffs and show you a true chronicle. It instead assumes that you know what commits are, and that you are asking for an easy to read overview of what has been going on.

Accepting that commits are always solely snapshots will make the issues you run into when working with the porcelain easier to understand, especially when exposed to more than one client.

(Knowing about packfiles and delta compression can also be useful when looking into performance/resource utilization.)

Re: Hitting every branch on the way down

#142

Earlier quoted context omitted.

What git log shows is not "a lie", it is a part of its data model. Git is all of its commands, not just the low level details. Commits are both snapshots of the entire repo, and diffs, and delta compressions - none of these is "a lie".

> Commits are both snapshots of the entire repo, and diffs, and delta compressions - none of these is "a lie". Commits are never diffs. Commits are snapshots, and sometimes git computes a diff between two commits. Commits are also never delta compressions, but can be stored within a delta-compressed packfile. Whether you like it or not, git is primarily its low level details. The porcelain stacked on top changes, and…

*However, that "git log -p" is "part of git" does not change that git log -p is...

Re: Hitting every branch on the way down

#143
post #97

Earlier quoted context omitted.

--force-with-lease And only on working branches. I do this every single day.

Not good enough, that can mean you rebase changes that someone else has based further work on (but hasn't pushed it yet, or has pushed it to a different branch).

Why are you having people base their work off your in progress work? Git is not the issue with what you are describing.

Re: Hitting every branch on the way down

#144
post #97

Earlier quoted context omitted.

Not good enough, that can mean you rebase changes that someone else has based further work on (but hasn't pushed it yet, or has pushed it to a different branch).

Why are you having people base their work off your in progress work? Git is not the issue with what you are describing.

> Why are you having people base their work off your in progress work?

To collaborate more closely and reduce (or get ahead of) conflicts. The whole point of using git at all is to be able to base your work off other people's in-progress work; if you're not interested in doing that then Subversion works better.

Post reply on HN