News for hackers. Stuff that matters.
Re:A Git query language by jordigh on Wednesday December 14, 2016 @11:34AM (#13177257)
I believe the goal is to get a diff, not a list of commits, in which case you need to figure out an expression for getting the last commit common to master and experiment so you can diff it with experiment.
Re:A Git query language by luhn on Wednesday December 14, 2016 @11:38AM (#13177297)
`git diff master..experiment`
Re:A Git query language by jordigh on Wednesday December 14, 2016 @11:45AM (#13177348)
I just tried that, and it seems to be the same as `git diff master experiment`. We don't want to diff the two heads. The command in Mercurial is `hg diff -r 'ancestor(master, experiment)' -r experiment`. Comrade trolor seems to have found the correct git expression.
Re:A Git query language by dminor on Wednesday December 14, 2016 @12:23PM (#13177709)
Try

    git diff master...experiment
(note there's three periods)
Re:A Git query language by jordigh on Wednesday December 14, 2016 @12:38PM (#13177879)
That works. Can you explain why? Does diff see this as a single commit or as set of commits? If it sees it as a set, how does it decide what two commits to diff from that set? If it's just one, what does it decide to diff?

I'm kind of confused because gitrevisions(7) says the triple dot is symmetric difference, but exchanging master and experiment does not produce the same output from diff.

Re:A Git query language by dminor on Wednesday December 14, 2016 @02:33PM (#13178964)
Not so helpfully it has a different meaning in 'git diff' than in 'git log'. Basically, it means the difference in the second branch from the first common ancestor of the two branches.