News for hackers. Stuff that matters.
Re:Why SQLite Does Not Use Git by jperras on Tuesday April 10, 2018 @07:36PM (#16806685)
> Git has no file object, it versions the repo, not files.

As someone who has used (in a professional setting) version control systems ranging from RCA to SVN to the current crop (git, mercurial, even darcs), the fact that git versions the repository as a whole instead of individual files is a godsend.

You've not known hell until you've had to deal with an RCA/CVS repository with 15+ years of history and thousands of files, each that maintains their own version history (and associated version number!).

I'd gladly take the comparative "slowness" of git when dealing with large repositories.

> Git is basically a tarball server. Calling that a source management system is an enormous stretch.

What, in your opinion, is the definition of a version control system then?

Re:Why SQLite Does Not Use Git by luckydude on Tuesday April 10, 2018 @07:57PM (#16806845)
A version control system is an accurate audit trail of everything that has happened in the repository. Every create, delete, rename, every rwx mode change, every content change.

In BitKeeper files work like they do in Unix, there is a (globally) unique name for each file object. Where the object lives in the repository is an attribute of that object, as are the contents, the permissions, who has changed etc.

Here's a super common workflow that's easy in BitKeeper and miserable in Git. I'm debugging an assert. I want to see who added the assert. I pop into the gui that shows me the per file graph and contents, search for the assert, hover over the rev and see that it was done a long time ago. I look in the area above the assert and I see a recent change, hover over that, see the comments and go "hmm, maybe this". Double click that line and I pop into a different gui that shows me the whole commit that contains that suspect line.

Note that because I have a graph per file, I have checkin comments per file. More work for you poor committers but a godsend for us debuggers. More breadcrumbs are more better.

In Git, less breadcrumbs, single commit message. Git wants to go from the rev to the commit, it's miserable to look around in a file and then go backwards to the commit.

When I was supporting BitKeeper our average response time to bug report or a crash report was 25 minute. 24x7. The only reason it was that long was because we were all in North America so there was a window where we were all asleep. Response time 6am-6pm PST was typically under 5 minutes. And I credit the fact that the tool accurately recorded everything and you could find the history really easily.

Oh, and it didn't slow down as the repo got big. Git is fine in little repos but it sucks pretty hard in big ones. Sucks even worse if you are on NFS. I can dig up benchmarks, we built up a synthetic 4M file repo and ran a bunch of tests on it (it was a modified version of the facebook repo builder, the facebook one had some stuff in it that made Git look incredibly bad, we looked at that and decided that wasn't real world or fair, we took that part out).

Re:Why SQLite Does Not Use Git by jperras on Tuesday April 10, 2018 @10:12PM (#16807517)
> Here's a super common workflow that's easy in BitKeeper and miserable in Git. I'm debugging an assert. I want to see who added the assert. I pop into the gui that shows me the per file graph and contents, search for the assert, hover over the rev and see that it was done a long time ago. I look in the area above the assert and I see a recent change, hover over that, see the comments and go "hmm, maybe this". Double click that line and I pop into a different gui that shows me the whole commit that contains that suspect line.

I may be misunderstanding that particular workflow (I'm sadly unfamiliar with bitkeeper), but this seems like a workflow that I accomplish relatively often with the use of tig[1].

On a separate note: thank you for the wonderfully detailed reply. It's such a pleasure to have an opposing view be so thoroughly explained.

[1]: https://jonas.github.io/tig/

Edit: I apologize that my first, original comment seems to have brought out the incorrigible tech trolls. Sometimes the internet is the worst.

Re:Why SQLite Does Not Use Git by Aissen on Wednesday April 11, 2018 @03:21AM (#16808793)
Indeed, there are many tools to do that with git. I use vim with vim-fugitive (:Gblame, then o to open the commit I want to look at), but most IDEs do that to.
Re:Why SQLite Does Not Use Git by luckydude on Tuesday April 10, 2018 @10:49PM (#16807652)
Heh, no worries dude (or dudette), I have dealt with the trolls. You can't post that the sky is blue without getting the trolls telling you are doing it wrong.

Every day humans make me again realize that I love my dogs, and respect my dogs, more than humans. There are exceptions but they are few and far between.

Re:Why SQLite Does Not Use Git by paulwal on Monday April 16, 2018 @03:56PM (#16852150)
Any thoughts on Fossil?

Edit: Never mind, I see you answered this below. https://news.ycombinator.com/item?id=16807319

Re:Why SQLite Does Not Use Git by philipwhiuk on Tuesday April 10, 2018 @08:24PM (#16806988)
> In Git, less breadcrumbs, single commit message. Git wants to go from the rev to the commit, it's miserable to look around in a file and then go backwards to the commit.

Less, better breadcrumbs, yes.

Re:Why SQLite Does Not Use Git by luckydude on Tuesday April 10, 2018 @08:48PM (#16807119)
A thought not universally shared. Intel was our biggest customer and when they saw the quality of the breadcrumbs produced by our gui check in tool vs the command line checkins they were smart enough to push hard that everyone used the guis.

I get why, as a dev, you want git commit -m'Fixed bug' but as the debugger guy, the reviewer gui, anyone who reads the code, that's a horrible thing to do to those readers.

Who, if you wait long enough, will be you. And I'll laugh my ass off at all the lazy committers who really could use more breadcrumbs when they have to debug their code later. Been there, done that, I haven't worked with people that lazy in decades.

edit: since HN won't let me extend the thread, let me reply to the comment below because BK does do something special.

The GUI for checkins presents you with a list of files, a place to type comments, and a big pane that shows the diffs. You type in comments for the first file, go to the next, type in comments (yes, there is a way to say use the previous comments). As you move from file to file, the bottom pane shows the diffs for that file so you can see what changed in that file.

The special sauce, that Git most definitely does not have, is when you get to the last file, which in BK is the ChangeSet file, this is where you would type the commit message. What are the diffs? There aren't any so we stuff all the comments you just typed on individual files. What does that do? Well, on the files you are usually typing in details of how you did this or that, when you get to all of those comments, you naturally uplevel and type in why you were doing all that.

It dramatically increases the usefulness of commit messages. That's why Intel pretty much mandated the use of the gui checkin vs the command line checkin.

Re:Why SQLite Does Not Use Git by kadenshep on Tuesday April 10, 2018 @09:11PM (#16807233)
To anyone reading, bitkeeper does nothing special in this regard. Enforce commit message standards, plenty of platforms and systems built around git (and literally every other SCM) have support for this.

Here's what he's taking about: http://www.bitkeeper.org/man/citool.html and http://www.bitkeeper.org/man/templates.html

Here is git's analogous feature: https://robots.thoughtbot.com/better-commit-messages-with-a-...

It's possibly the least interesting and least unique selling point an SCM can have. It's really funny that you keep bringing up this example around the thread.

EDIT: To respond to the above edit:

Again, he's Proving The Point. Commits should be atomic. If you have to individually comment on file changes then the correct thing to do would be to put those in their own commit, no? I'm not really sure what's being described is necessarily a cool feature, but rather a way to avoid making sure your changes are truly related. I honestly don't see the point. This seems like a feature that was written because of the decisions that were made into how BitKeeper works internally, not because it's a fantastic idea. You can get the same thing with atomic commits in git. You comment per file, because BK tracks changes per file. Git does not do this. You should be making your commits atomic because git is tracking the actual content. Atomic commits will accurately describe what's being changed, and then of course those all get lumped together in a patch/PR.

Git isn't lacking the feature you're describing, it just kind of is there without any extra data tracking required, because it's not making up for technical design decisions.

Re:Why SQLite Does Not Use Git by hermitdev on Tuesday April 10, 2018 @08:10PM (#16806919)
> As someone who has used (in a professional setting) version control systems ranging from RCA to SVN to the current crop (git, mercurial, even darcs), the fact that git versions the repository as a whole instead of individual files is a godsend.

This. A thousand times this. A change isn't a single file, it's likely a changeset of multiple, sometimes hundreds or thousands of files. Most often, you need to know the entire changeset, not just what happened with one file. This is especially true of large-scale refactoring where you're changing the public interface of something. Depending, that can have a far-ranging impact and you want to see that history all together.

Re:Why SQLite Does Not Use Git by luckydude on Tuesday April 10, 2018 @09:00PM (#16807171)
You're talking to the guy that created that concept [1]. I get that changesets are cool :) You're right, you do want to see all that info together.

But lots of times you want to look at the file view, find the line of code that looks like the problem, and then zoom out to the changeset. BK makes that trivial, Git makes that miserable to impossible.

[1] Actually there was a little known system, Aide-de-camp, that one of my people told me about that had changesets so I didn't invent it, but I reinvented it. And made the world aware of the concept. Back when you could search Usenet via dejanews you could search for "changeset" and date limit it to before me talking about it. There were maybe 5 hits. A few years after BK came along there were 100's of thousands of hits. So I wasn't first but I am definitely the reason that you know what a changeset is.

Re:Why SQLite Does Not Use Git by pdfernhout on Wednesday April 11, 2018 @11:52AM (#16812357)
As partial support for this, the GitLens plugin in Visual Studio Code provides a blame annotation in the IDE for each line which includes the commit info as a hover: https://marketplace.visualstudio.com/items?itemName=eamodio....

Thanks for your contributions to better SCM design through BK. I agree with the potential value of tracking files and branches as well as commits and being able to easily navigate through that space -- as well as the emphasis on adding more metadata to make future understanding easier.

It's unfortunate we don't have a better funding model for FOSS development (or alternatively a basic income) because otherwise BitKeeper might have been open from the start -- and then we might have avoided the limitations of git as a hasty workaround for licensing issues.

Re:Why SQLite Does Not Use Git by Pyxl101 on Tuesday April 10, 2018 @09:42PM (#16807355)
> But lots of times you want to look at the file view, find the line of code that looks like the problem, and then zoom out to the changeset. BK makes that trivial, Git makes that miserable to impossible.

This criticism doesn't ring true for me. What are you saying is missing in the Git experience?

In Git, I would use `git blame` to determine which commit contributed the problematic line in question. It displays the file along with the commit that most recently modified each line. At that point, I know which commit last changed the line (and the commit is the changeset). Aren't we done?

If I need more history, I can use `git log` on the filename to see what commits have changed that file over time, and I can inspect how each commit individually changed the file if needed. There are editor-integrated tools to walk back through this history easily.

Re:Why SQLite Does Not Use Git by bzbarsky on Wednesday April 11, 2018 @01:10AM (#16808229)
> What are you saying is missing in the Git experience?

A `git blame` that doesn't take forever to run. Especially in the face of file moves and renames.

Re:Why SQLite Does Not Use Git by plorkyeran on Tuesday April 10, 2018 @09:40PM (#16807342)
Looking at a file, and then looking the commit which last modified a specific line in that file is a trivial operation in git that I do on a regular basis.
Re:Why SQLite Does Not Use Git by luckydude on Tuesday April 10, 2018 @11:38PM (#16807850)
How long does that take? In BK it's as fast as you can click. If git is like that what tools are you using to do that?
Re:Why SQLite Does Not Use Git by plorkyeran on Wednesday April 11, 2018 @12:01PM (#16812464)
On the largest repos I've worked with `git blame` takes a second or two: long enough to be annoying and make me wish it was a bit faster, but still fast enough for interactive use and well short of the threshold where I would be tempted to context switch after invoking the command. On most repos it's perceptively instant.

I suspect on a HDD `git blame` would be unbearably slow on anything but the smallest of repositories, but it has been many years since I last worked with source code stored on a HDD.

Re:Why SQLite Does Not Use Git by fyi1183 on Wednesday April 11, 2018 @01:28AM (#16808303)

    git log -- filename
Unless the file hasn't been touched for many years in a Linux kernel size repository, that's faster than you can blink.

I do occasionally wish that git blame was faster. Building up a cache of side index information for that would be a nice addition.

Re:Why SQLite Does Not Use Git by takeda on Wednesday April 11, 2018 @11:14AM (#16811924)
That's true, I'm not the op, but changesets get in a way when using git for SCM, where the typical workflow is to merge between two branches on the level of subdirectories.

In my company people simply use checkout to apply changes from another branch, but that doesn't handle well for example file removals. It also creates a completely different commit so the branches diverge more and more, making things like rebase more time consuming.

It is a huge pain, which would not exist if we would use SVN as a backed for example.

Re:Why SQLite Does Not Use Git by fyi1183 on Thursday April 12, 2018 @01:40AM (#16818312)
I agree that that's not well supported, because it kind of goes against the grain of git thinking about project versions rather than file or directory versions.

What you should probably do in this case is use git merge nevertheless, but reset all changes outside of the directory of interest before committing the merge. This way, you get the history of the merge in the DAG, which will make git's merge resolution work.

Unfortunately, I'm not aware of a built-in way of doing this.

Re:Why SQLite Does Not Use Git by lokedhs on Tuesday April 10, 2018 @09:42PM (#16807351)
What do you mean when you say "look at the file view". I read that as just looking at an annotate view and then find the changelist that the change was part of.

However, this is something every single version control system can do, so surely you were referring to something else. Could you explain what operation you were referring to?

Re:Why SQLite Does Not Use Git by luckydude on Tuesday April 10, 2018 @10:01PM (#16807465)
So BK is kinda weird in that the metadata that binds all the files together in a commit is just another version controlled file.

We built a GUI tool that lets you look at a versioned file, it shows you the graph in the top pane and either diffs between two versions or the contents of a particular version in the bottom pane.

It's the goto tool for figuring out stuff. It is not just a GUI version of "git blame". When you use it you can see the history of each line by hovering over that line, you get a popup that shows the checkin comments for that line. And it is fast, as in below human reaction time, so you use that feature.

And you can double click on any line and boom, you are looking at the changeset that introduced that line.

I'm tired so I'm probably not doing a good job explaining this, but we supported commercial customers for a couple of decades and we had just incredible response time to each issue and I credit this work flow for that. Someone would call and say I have this assert and one of would get into the gui, start looking and we would know the cause of the problem in seconds or single digit minutes and I don't me 5-10 minutes, I mean 1-2 minutes.

Maybe I'm clueless and there is a way to do this in git but I haven't found it. When I have to work with git repos I fast-export them into BK just so I can have a more sane way to look at the history. It's not great history but it's better than Git.

Edit: I didn't explain what that gui did on the ChangeSet file. So that's what gitk (gittk?) is, it shows you the repo graph. You can click on a node and see the commit, you can left click and right click and see the diffs between those changesets.

So far as I know, BK is the only system that puts the metadata in the same system as the user data.

Re:Why SQLite Does Not Use Git by _ph_ on Wednesday April 11, 2018 @01:56AM (#16808412)
SVN does version the whole repository, so a revision can contain any number of changes to files, but it tracks eachs files history too. So a SVN revision is a collection of changes to any number of files/directories.