Git, history modification, and libuv
There has been a recent kerfuffle over a pull request to libuv: it was rejected, applied, reverted, and re-applied. There was some question as to the authorship of that commit, and I wanted to show you why that was, because it illustrates how git handles history.
At first, the pull request was closed. Then, it was committed in 47d98b6. Then 804d40ee reverted that 47d98b6. But when you look at 804d40ee on GitHub, you’ll see no indication of which branch it’s on. That’s because it’s not on any branch. If you clone down libuv, and try to find the commit, you’ll see it’s not there:
~/libuv(master)$ git log 804d40e fatal: ambiguous argument '804d40e': unknown revision or path not in the working tree.
Let’s make a test repository:
$ mkdir test $ cd test $ git init Initialized empty Git repository in /home/action/test/.git/ $ touch HELLO.md $ git add HELLO.md $ git commit -m...
Continue reading →