Fossil SCM

Explained --no-merges vs --first-parent in Case Study 1 of the gitusers doc.

wyoung 2020-11-02 09:01 trunk
Commit d09431bb0829382ec5107b2e3833f409ea6a9613ec2b8b52e624a1d207ba2c32
1 file changed +9
--- www/gitusers.md
+++ www/gitusers.md
@@ -846,10 +846,19 @@
846846
on [Git’s own repository][gitgh]: it gives [this commit][grpgh]! Though
847847
GitHub shows the date we asked for, the `git show` command above gives
848848
the confusing result referenced in the story.
849849
This fixup within GitHub is success, of a sort, though it leaves us wondering why there’s a
850850
discrepancy.
851
+
852
+You may have noticed the difference between my story’s final command and
853
+the one given on Stack Overflow: `--first-parent` versus `--no-merges`.
854
+As far as I can tell, the SO answer is wrong, a conclusion I came to
855
+while writing this reply and finding that it didn’t do what I expected.
856
+None of the answers on that page give the `--no-merges` option. This is
857
+one of the sneaky problems with complicated commands: people copy them
858
+around from place to place without trying to understand them first, so
859
+errors propagate.
851860
852861
But hark! The same Stack Overflow answer gives a much simpler
853862
alternative based on Git’s [`rev-parse` feature][grp]:
854863
855864
git checkout master@{2020-04-12}
856865
--- www/gitusers.md
+++ www/gitusers.md
@@ -846,10 +846,19 @@
846 on [Git’s own repository][gitgh]: it gives [this commit][grpgh]! Though
847 GitHub shows the date we asked for, the `git show` command above gives
848 the confusing result referenced in the story.
849 This fixup within GitHub is success, of a sort, though it leaves us wondering why there’s a
850 discrepancy.
 
 
 
 
 
 
 
 
 
851
852 But hark! The same Stack Overflow answer gives a much simpler
853 alternative based on Git’s [`rev-parse` feature][grp]:
854
855 git checkout master@{2020-04-12}
856
--- www/gitusers.md
+++ www/gitusers.md
@@ -846,10 +846,19 @@
846 on [Git’s own repository][gitgh]: it gives [this commit][grpgh]! Though
847 GitHub shows the date we asked for, the `git show` command above gives
848 the confusing result referenced in the story.
849 This fixup within GitHub is success, of a sort, though it leaves us wondering why there’s a
850 discrepancy.
851
852 You may have noticed the difference between my story’s final command and
853 the one given on Stack Overflow: `--first-parent` versus `--no-merges`.
854 As far as I can tell, the SO answer is wrong, a conclusion I came to
855 while writing this reply and finding that it didn’t do what I expected.
856 None of the answers on that page give the `--no-merges` option. This is
857 one of the sneaky problems with complicated commands: people copy them
858 around from place to place without trying to understand them first, so
859 errors propagate.
860
861 But hark! The same Stack Overflow answer gives a much simpler
862 alternative based on Git’s [`rev-parse` feature][grp]:
863
864 git checkout master@{2020-04-12}
865

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button