-
-
Save shadercoder/a05a225886523c224e035b647734eab3 to your computer and use it in GitHub Desktop.
Revisions
-
datagrok revised this gist
Aug 22, 2016 . 1 changed file with 81 additions and 40 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,52 +16,93 @@ To simulate: git commit --allow-empty -m "initial empty commit" git branch dev for x in `seq 4`; do git commit --allow-empty -m "commit" git checkout dev git merge --no-ff --no-edit master git checkout master done The result: $ git log --graph --topo-order --decorate --oneline --all * f19e46d (dev) Merge branch 'master' into dev |\ | * 600a33f (HEAD, master) commit * | c9ccbf1 Merge branch 'master' into dev |\ \ | |/ | * 4c1fb52 commit * | dfdcb8a Merge branch 'master' into dev |\ \ | |/ | * 42b1c24 commit * | 7714be3 Merge branch 'master' into dev |\ \ | |/ | * f7eae2d commit |/ * 885700a initial empty commit What I would like it to display: $ git log --graph --topo-order --decorate --oneline --all * f19e46d (dev) Merge branch 'master' into dev |\ | * 600a33f (HEAD, master) commit * | c9ccbf1 Merge branch 'master' into dev |\| | * 4c1fb52 commit * | dfdcb8a Merge branch 'master' into dev |\| | * 42b1c24 commit * | 7714be3 Merge branch 'master' into dev |\| | * f7eae2d commit |/ * 885700a initial empty commit ## `--boundary` makes mountains The previous example wasn't so bad. But we had the luxury of having only two branches in the repo, with not many commits on each, allowing us to specify --all. Let's now assume there are many branches. A way to ask for the graph of a long-running parallel development branch that merges frequently from master might be to show the log for `master..branch`, but also to use `--boundary`. But, that produces this strange mountainous result: $ git log --graph --topo-order --decorate --oneline --boundary master..dev * f19e46d (dev) Merge branch 'master' into dev |\ * \ c9ccbf1 Merge branch 'master' into dev |\ \ * \ \ dfdcb8a Merge branch 'master' into dev |\ \ \ * \ \ \ 7714be3 Merge branch 'master' into dev |\ \ \ \ | | | | o 600a33f (HEAD, master) commit | | | |/ | | | o 4c1fb52 commit | | |/ | | o 42b1c24 commit | |/ | o f7eae2d commit |/ o 885700a initial empty commit That's a big diagram for only 5 commits and 5 merges! As with the previous example, I think this should output: $ git log --graph --topo-order --decorate --oneline --boundary master..dev * f19e46d (dev) Merge branch 'master' into dev |\ | o 600a33f (HEAD, master) commit * | c9ccbf1 Merge branch 'master' into dev |\| | o 4c1fb52 commit * | dfdcb8a Merge branch 'master' into dev |\| | o 42b1c24 commit * | 7714be3 Merge branch 'master' into dev |\| | o f7eae2d commit |/ * 885700a initial empty commit ## Let me specify which branches sink to the left. @@ -203,61 +244,61 @@ To simulate: The result: * 85a4880 (HEAD, master) Merge branch 'feature-3' |\ | * 6057a0a commit 3-1.3 | * aa2d7e7 commit 3-1.2 | * c5130d2 commit 3-1.1 * | a6f44d9 Merge branch 'feature-2' |\ \ | * | 97612ed commit 2-1.3 | * | f3e66fc commit 2-1.2 | * | 2a5af7a commit 2-1.1 * | | 02bfff3 Merge branch 'feature-1' |\ \ \ | * | | 50a334e commit 1-1.3 | * | | 29d5386 commit 1-1.2 | * | | eccd08a commit 1-1.1 * | | | d185b26 Merge branch 'feature-4' |\ \ \ \ | * | | | 6c044c8 commit 4-1.3 | * | | | 3f9cdd9 commit 4-1.2 | * | | | 5da9916 commit 4-1.1 * | | | | bcc9b74 Merge branch 'feature-5' |\ \ \ \ \ | * | | | | 56ef96c commit 5-1.3 | * | | | | 22d50d7 commit 5-1.2 | * | | | | 5d539a3 commit 5-1.1 * | | | | | 84b1d36 Merge branch 'feature-6' |\ \ \ \ \ \ | * | | | | | b5f5ef6 commit 6-1.3 | * | | | | | 691a8f6 commit 6-1.2 | * | | | | | 50dc2ae commit 6-1.1 |/ / / / / / * | | | | | 989fe62 start of feature-6 |/ / / / / * | | | | 22fc09d start of feature-5 |/ / / / * | | | 7b9ac41 start of feature-4 | |_|/ |/| | * | | 4fbc57e start of feature-3 | |/ |/| * | e4c2da5 start of feature-2 |/ * 9f0e3b1 start of feature-1 * f7d3186 initial empty commit I'd like to be able to elide branch tails, maybe only when they split from the same branch that they will eventually merge into: * 85a4880 (HEAD, master) Merge branch 'feature-3' |\ | * 6057a0a commit 3-1.3 | * aa2d7e7 commit 3-1.2 | * c5130d2 commit 3-1.1 | : * a6f44d9 Merge branch 'feature-2' |\ | * 97612ed commit 2-1.3 | * f3e66fc commit 2-1.2 | * 2a5af7a commit 2-1.1 @@ -281,7 +322,7 @@ I'd like to be able to elide branch tails, maybe only when they split from the s | * 5d539a3 commit 5-1.1 | : * 84b1d36 Merge branch 'feature-6' |\ | * b5f5ef6 commit 6-1.3 | * 691a8f6 commit 6-1.2 | * 50dc2ae commit 6-1.1 -
datagrok revised this gist
Aug 22, 2016 . 1 changed file with 123 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -170,3 +170,126 @@ With different line-drawing logic and forced columns, it might look like this: * 7382440 initial empty commit I think that it is much easier with that visualization to track which commits are in master and dev, and see the points at which other branches forked from and merged with them. ## Elide "branch tails" to avoid "mountains" Consider a workflow where feature branches diverge from some integration branch like "master," are worked on for some time, and are then merged back into that upstream branch. They may be worked on concurrently, and they may or may not be merged in the same order that they were begun. They often have long tails that show where the branch was started, which is information I don't really need. When too many of these tails collect in the output, they become impossible to visually trace, forming an ugly "mountain." To simulate: git init example cd example git commit --allow-empty -m "initial empty commit" for b in 1 2 3 4 5 6; do git checkout master git commit --allow-empty -m "start of feature-$b" git branch feature-$b done for x in `seq 3`; do for b in 1 2 3 4 5 6; do git checkout feature-$b git commit --allow-empty -m "commit $b-1.$x" done done git checkout master for b in 6 5 4 1 2 3; do git checkout master git merge --no-ff --no-edit feature-$b git branch -d feature-$b done The result: * 85a4880 (HEAD, master) Merge branch 'feature-3' |\ | * 6057a0a commit 3-1.3 | * aa2d7e7 commit 3-1.2 | * c5130d2 commit 3-1.1 * | a6f44d9 Merge branch 'feature-2' |\ \ | * | 97612ed commit 2-1.3 | * | f3e66fc commit 2-1.2 | * | 2a5af7a commit 2-1.1 * | | 02bfff3 Merge branch 'feature-1' |\ \ \ | * | | 50a334e commit 1-1.3 | * | | 29d5386 commit 1-1.2 | * | | eccd08a commit 1-1.1 * | | | d185b26 Merge branch 'feature-4' |\ \ \ \ | * | | | 6c044c8 commit 4-1.3 | * | | | 3f9cdd9 commit 4-1.2 | * | | | 5da9916 commit 4-1.1 * | | | | bcc9b74 Merge branch 'feature-5' |\ \ \ \ \ | * | | | | 56ef96c commit 5-1.3 | * | | | | 22d50d7 commit 5-1.2 | * | | | | 5d539a3 commit 5-1.1 * | | | | | 84b1d36 Merge branch 'feature-6' |\ \ \ \ \ \ | * | | | | | b5f5ef6 commit 6-1.3 | * | | | | | 691a8f6 commit 6-1.2 | * | | | | | 50dc2ae commit 6-1.1 |/ / / / / / * | | | | | 989fe62 start of feature-6 |/ / / / / * | | | | 22fc09d start of feature-5 |/ / / / * | | | 7b9ac41 start of feature-4 | |_|/ |/| | * | | 4fbc57e start of feature-3 | |/ |/| * | e4c2da5 start of feature-2 |/ * 9f0e3b1 start of feature-1 * f7d3186 initial empty commit I'd like to be able to elide branch tails, maybe only when they split from the same branch that they will eventually merge into: * 85a4880 (HEAD, master) Merge branch 'feature-3' |\ | * 6057a0a commit 3-1.3 | * aa2d7e7 commit 3-1.2 | * c5130d2 commit 3-1.1 | : * a6f44d9 Merge branch 'feature-2' |\ | * 97612ed commit 2-1.3 | * f3e66fc commit 2-1.2 | * 2a5af7a commit 2-1.1 | : * 02bfff3 Merge branch 'feature-1' |\ | * 50a334e commit 1-1.3 | * 29d5386 commit 1-1.2 | * eccd08a commit 1-1.1 | : * d185b26 Merge branch 'feature-4' |\ | * 6c044c8 commit 4-1.3 | * 3f9cdd9 commit 4-1.2 | * 5da9916 commit 4-1.1 | : * bcc9b74 Merge branch 'feature-5' |\ | * 56ef96c commit 5-1.3 | * 22d50d7 commit 5-1.2 | * 5d539a3 commit 5-1.1 | : * 84b1d36 Merge branch 'feature-6' |\ | * b5f5ef6 commit 6-1.3 | * 691a8f6 commit 6-1.2 | * 50dc2ae commit 6-1.1 |/ * 989fe62 start of feature-6 * 22fc09d start of feature-5 * 7b9ac41 start of feature-4 * 4fbc57e start of feature-3 * e4c2da5 start of feature-2 * 9f0e3b1 start of feature-1 * f7d3186 initial empty commit -
datagrok revised this gist
Mar 2, 2013 . 1 changed file with 54 additions and 41 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ # Ideas for improvements to `git log --graph` I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first. ## Make the graph for `--topo-order` less wiggly Imagine a long-running development branch periodically merges from master. The `git log --graph --all --topo-order` is not as simple as it could be, as of git version 1.7.10.4. It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly. @@ -24,32 +24,32 @@ To simulate: git checkout master done The result: $ git log --graph --all --topo-order --decorate --oneline --boundary * a9f8d93 (dev) Merge branch 'master' into dev |\ | * 5f32650 (HEAD, master) commit * | b511501 Merge branch 'master' into dev |\ \ | |/ | * 4e6810e commit * | 2cd55b4 Merge branch 'master' into dev |\ \ | |/ | * 4f74695 commit * | 372799e Merge branch 'master' into dev |\ \ | |/ | * 076669f commit |/ * 7382440 initial empty commit What I would like it to display: $ git log --graph --all --topo-order --decorate --oneline --boundary * a9f8d93 (dev) Merge branch 'master' into dev |\ | * 5f32650 (HEAD, master) commit * | b511501 Merge branch 'master' into dev |\| @@ -60,7 +60,7 @@ What I want it to show: * | 372799e Merge branch 'master' into dev |\| | * 076669f commit |/ * 7382440 initial empty commit ## Let me specify which branches sink to the left. @@ -72,11 +72,11 @@ Using the very same repo above, I'd like to say "make left-most columns for mast $ git log --graph --all --topo-order --decorate --oneline --boundary --force-branch-columns=master,dev .-- master | .-- dev v v * a9f8d93 (dev) Merge branch 'master' into dev /| * | 5f32650 (HEAD, master) commit | * b511501 Merge branch 'master' into dev |/| @@ -87,65 +87,76 @@ Using the very same repo above, I'd like to say "make left-most columns for mast | * 372799e Merge branch 'master' into dev |/| * | 076669f commit \| * 7382440 initial empty commit Maybe that doesn't seem like it's of much value, but let's throw another branch into the mix and see what it might look like. Branch from somewhere in the middle of `dev`, create two commits, then merge from `master`: git checkout -b newbranch dev~3 echo 2 >> 2.txt; git add 2.txt; git commit -m "commit" echo 2 >> 2.txt; git add 2.txt; git commit -m "commit" git merge --no-ff --no-edit master The unmodified result: $ git log --graph --all --topo-order --decorate --oneline --boundary * f745bf5 (HEAD, newbranch) Merge branch 'master' into newbranch |\ * | 7031537 commit * | 416ab2c commit | | * a9f8d93 (dev) Merge branch 'master' into dev | | |\ | | |/ | |/| | * | 5f32650 (master) commit | | * b511501 Merge branch 'master' into dev | | |\ | | |/ | |/| | * | 4e6810e commit | | * 2cd55b4 Merge branch 'master' into dev | | |\ | |/ / |/| / | |/ | * 4f74695 commit * | 372799e Merge branch 'master' into dev |\ \ | |/ | * 076669f commit |/ * 7382440 initial empty commit What's most striking to me about the as-is unmodified output is the frequency with which we see this cross-legged pattern: * b511501 Merge branch 'master' into dev |\ |/ /| * | 4e6810e commit * 2cd55b4 Merge branch 'master' into dev Is the output perhaps intentionally like this to show which parent of a merge commit is the "first" parent? If so, that may be useful sometimes, so I wouldn't want to see that style completely removed in favor of my suggestion. With different line-drawing logic and forced columns, it might look like this: $ git log --graph --all --topo-order --decorate --oneline --boundary --force-branch-columns=master,dev .-- master | .-- dev v v * f745bf5 (HEAD, newbranch) Merge branch 'master' into newbranch /| / * 7031537 commit / * 416ab2c commit | * | a9f8d93 (dev) Merge branch 'master' into dev |/| | * | | 5f32650 (master) commit | * | b511501 Merge branch 'master' into dev |/| | * | | 4e6810e commit | * | 2cd55b4 Merge branch 'master' into dev |/|/ @@ -155,5 +166,7 @@ With different logic and forced columns, it could look like this: | * 372799e Merge branch 'master' into dev |/| * | 076669f commit \| * 7382440 initial empty commit I think that it is much easier with that visualization to track which commits are in master and dev, and see the points at which other branches forked from and merged with them. -
datagrok revised this gist
Mar 2, 2013 . 1 changed file with 91 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,9 @@ I will maybe someday get around to dusting off my C and making these changes mys ## Make the graph for --topo-order less wiggly Imagine a long-running development branch periodically merges from master. The 'git log --graph --all --topo-order' is not as simple as it could be, as of git version 1.7.10.4. It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly. To simulate: @@ -65,6 +67,93 @@ What I want it to show: Sometimes I'm faced with a very complex mess of merges and branches. I'd like to be able to ask git log to show me the graph, but to always set commits from specific branches into specific columns in the output. This might make for more line-drawing to connect the commits, but that's okay in this situation. Using the very same repo above, I'd like to say "make left-most columns for master and dev, in that order" and see: $ git log --graph --all --topo-order --decorate --oneline --boundary --force-branch-columns=master,dev .-- master | .-- dev v v * a9f8d93 (dev) Merge branch 'master' into dev /| * | 5f32650 (HEAD, master) commit | * b511501 Merge branch 'master' into dev |/| * | 4e6810e commit | * 2cd55b4 Merge branch 'master' into dev |/| * | 4f74695 commit | * 372799e Merge branch 'master' into dev |/| * | 076669f commit \| * 7382440 initial empty commit Maybe that doesn't seem like it's of much value, but let's throw another branch into the mix and see what it looks like. Branch from somewhere in the middle of dev, create two commits, then merge from master: git checkout -b newbranch dev~3 echo 2 >> 2.txt; git add 2.txt; git commit -m "commit" echo 2 >> 2.txt; git add 2.txt; git commit -m "commit" git merge --no-ff --no-edit master How's it look? $ git log --graph --all --topo-order --decorate --oneline --boundary * f745bf5 (HEAD, newbranch) Merge branch 'master' into newbranch |\ * | 7031537 commit * | 416ab2c commit | | * a9f8d93 (dev) Merge branch 'master' into dev | | |\ | | |/ | |/| | * | 5f32650 (master) commit | | * b511501 Merge branch 'master' into dev | | |\ | | |/ | |/| | * | 4e6810e commit | | * 2cd55b4 Merge branch 'master' into dev | | |\ | |/ / |/| / | |/ | * 4f74695 commit * | 372799e Merge branch 'master' into dev |\ \ | |/ | * 076669f commit |/ * 7382440 initial empty commit With different logic and forced columns, it could look like this: $ git log --graph --all --topo-order --decorate --oneline --boundary --force-branch-columns=master,dev .-- master | .-- dev v v * f745bf5 (HEAD, newbranch) Merge branch 'master' into newbranch /| / * 7031537 commit / * 416ab2c commit | * | a9f8d93 (dev) Merge branch 'master' into dev |/| | * | | 5f32650 (master) commit | * | b511501 Merge branch 'master' into dev |/| | * | | 4e6810e commit | * | 2cd55b4 Merge branch 'master' into dev |/|/ | / |/| * | 4f74695 commit | * 372799e Merge branch 'master' into dev |/| * | 076669f commit \| * 7382440 initial empty commit -
datagrok revised this gist
Mar 2, 2013 . 1 changed file with 23 additions and 64 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,19 @@ # Improvements I'd like to see for `git log --graph` I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first. ## Make the graph for --topo-order less wiggly Imagine a long-running development branch periodically merges from master. The 'git log --graph --all --topo-order' is not as simple as it could be. It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it compounds the problem. To simulate: git init example cd example git commit --allow-empty -m "initial empty commit" git branch dev for x in `seq 4`; do echo 1 >> 1.txt git add 1.txt git commit -m "commit" @@ -24,83 +25,41 @@ To simulate: The 'git log --graph --all --topo-order' is not as simple as it could be. $ git log --graph --all --topo-order --decorate --oneline --boundary * a9f8d93 (dev) Merge branch 'master' into dev |\ | * 5f32650 (HEAD, master) commit * | b511501 Merge branch 'master' into dev |\ \ | |/ | * 4e6810e commit * | 2cd55b4 Merge branch 'master' into dev |\ \ | |/ | * 4f74695 commit * | 372799e Merge branch 'master' into dev |\ \ | |/ | * 076669f commit |/ * 7382440 initial empty commit What I want it to show: $ git log --graph --all --topo-order --decorate --oneline --boundary * a9f8d93 (dev) Merge branch 'master' into dev |\ | * 5f32650 (HEAD, master) commit * | b511501 Merge branch 'master' into dev |\| | * 4e6810e commit * | 2cd55b4 Merge branch 'master' into dev |\| | * 4f74695 commit * | 372799e Merge branch 'master' into dev |\| | * 076669f commit |/ * 7382440 initial empty commit ## Let me specify which branches sink to the left. -
datagrok revised this gist
Mar 2, 2013 . 1 changed file with 57 additions and 159 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ # Improvements for `git log --graph` The following are changes that I would like to see made to `git log --graph` that I will maybe someday get around to making myself unless someone else does it first. ## Make the graph for --topo-order less wiggly Imagine a long-running development branch periodically merges from master. @@ -21,193 +23,89 @@ To simulate: The 'git log --graph --all --topo-order' is not as simple as it could be. $ git log --graph --all --topo-order --decorate --oneline --boundary * df39cf9 (dev) Merge branch 'master' into dev |\ | * 359aa09 (HEAD, master) commit * | b6fa2af Merge branch 'master' into dev |\ \ | |/ | * 38539f8 commit * | 142b270 Merge branch 'master' into dev |\ \ | |/ | * b12300f commit * | 1b54ca0 Merge branch 'master' into dev |\ \ | |/ | * acd9928 commit * | 4a9ae00 Merge branch 'master' into dev |\ \ | |/ | * 47b29a5 commit * | 38f2386 Merge branch 'master' into dev |\ \ | |/ | * d0143d5 commit * | 2687054 Merge branch 'master' into dev |\ \ | |/ | * 3e32c24 commit * | 53b1d95 Merge branch 'master' into dev |\ \ | |/ | * 3c86ded commit * | 342a0a2 Merge branch 'master' into dev |\ \ | |/ | * 903c70f commit * | 9eacdd6 Merge branch 'master' into dev |\ \ | |/ | * f0ab71f commit |/ * 52eebd3 initial empty commit What I want it to show: $ git log --graph --all --topo-order --decorate --oneline --boundary * df39cf9 (dev) Merge branch 'master' into dev |\ | * 359aa09 (HEAD, master) commit * | b6fa2af Merge branch 'master' into dev |\| | * 38539f8 commit * | 142b270 Merge branch 'master' into dev |\| | * b12300f commit * | 1b54ca0 Merge branch 'master' into dev |\| | * acd9928 commit * | 4a9ae00 Merge branch 'master' into dev |\| | * 47b29a5 commit * | 38f2386 Merge branch 'master' into dev |\| | * d0143d5 commit * | 2687054 Merge branch 'master' into dev |\| | * 3e32c24 commit * | 53b1d95 Merge branch 'master' into dev |\| | * 3c86ded commit * | 342a0a2 Merge branch 'master' into dev |\| | * 903c70f commit * | 9eacdd6 Merge branch 'master' into dev |\| | * f0ab71f commit |/ * 52eebd3 initial empty commit ## Let me specify which branches sink to the left. Sometimes I'm faced with a very complex mess of merges and branches. I'd like to be able to ask git log to show me the graph, but to always set commits from specific branches into specific columns in the output. This might make for more line-drawing to connect the commits, but that's okay in this situation. ( TODO ) -
datagrok revised this gist
Mar 2, 2013 . 2 changed files with 213 additions and 125 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,213 @@ Changes that I would like to see made to 'git log' that I will maybe someday get around to making myself unless someone else does it first. # Make the graph for --topo-order less wiggly Imagine a long-running development branch periodically merges from master. To simulate: git init example cd example git commit --allow-empty -m "initial empty commit" git branch dev for x in `seq 10`; do echo 1 >> 1.txt git add 1.txt git commit -m "commit" git checkout dev git merge --no-ff --no-edit master git checkout master done The 'git log --graph --all --topo-order' is not as simple as it could be. $ git log --graph --decorate --oneline --boundary --all --topo-order * 9d4e2af (dev) Merge branch 'master' into dev |\ | * 4831cd3 (HEAD, master) commit * | 9183324 Merge branch 'master' into dev |\ \ | |/ | * ef35b68 commit * | 844c979 Merge commit 'a95d7bf' into dev |\ \ | |/ | * a95d7bf commit * | 7ffa320 Merge commit '01e20e7' into dev |\ \ | |/ | * 01e20e7 commit * | 8da2968 Merge commit '76ee359' into dev |\ \ | |/ | * 76ee359 commit * | f7dee8c Merge commit '16ceaa0' into dev |\ \ | |/ | * 16ceaa0 commit * | ab3d909 Merge commit '6d366e8' into dev |\ \ | |/ | * 6d366e8 commit * | b7e2ee9 Merge commit '70f1d09' into dev |\ \ | |/ | * 70f1d09 commit * | 9423aaa Merge commit '18a737e' into dev |\ \ | |/ | * 18a737e commit * | 5625433 Merge commit 'afcdf74' into dev |\ \ | |/ | * afcdf74 commit |/ * 8d04df7 commit The graph gets even more prickly with --date-order. $ git log --graph --decorate --oneline --boundary --all --date-order * 482fc82 (dev) Merge branch 'master' into dev |\ * \ b6f20a6 Merge branch 'master' into dev |\ \ | | * 1aaf21d (HEAD, master) commit | |/ * | 6786a11 Merge branch 'master' into dev |\ \ | | * 13ebcbc commit | |/ * | 9907756 Merge branch 'master' into dev |\ \ | | * 02e8e58 commit | |/ * | e3881cd Merge branch 'master' into dev |\ \ | | * 01442f5 commit | |/ * | e271be9 Merge branch 'master' into dev |\ \ | | * fd01c50 commit | |/ * | d85e007 Merge branch 'master' into dev |\ \ | | * e76cbb4 commit | |/ * | 430784c Merge branch 'master' into dev |\ \ | | * 690c7c3 commit | |/ * | 44f31a6 Merge branch 'master' into dev |\ \ | | * 97e8d3b commit | |/ * | 852bfee Merge branch 'master' into dev |\ \ | | * 0d5e6cf commit | |/ | * 57a8a29 commit |/ * 7878b90 initial empty commit Even worse is the situation that arises when long-running development branch merges several commits from master, in order. To simulate: git init example cd example git commit --allow-empty -m "initial empty commit" initial="`git rev-list HEAD`" git branch dev for x in `seq 10`; do echo 1 >> 1.txt git add 1.txt git commit -m "commit" done git checkout dev for x in `git rev-list --reverse master ^dev`; do git merge --no-ff --no-edit $x done git checkout master The output from 'git log --graph --all --topo-order' is about the same as when the merges were interleaved: But the output from --date-order forms a mountain (and spikes the CPU, and slows down 'git log'): $ git log --graph --decorate --oneline --boundary --all --date-order ... * |\ | | * | 7ffa320 Merge commit '01e20e7' into dev |\ \ * \ \ 8da2968 Merge commit '76ee359' into dev |\ \ \ * \ \ \ f7dee8c Merge commit '16ceaa0' into dev |\ \ \ \ * \ \ \ \ ab3d909 Merge commit '6d366e8' into dev |\ \ \ \ \ * \ \ \ \ \ b7e2ee9 Merge commit '70f1d09' into dev |\ \ \ \ \ \ * \ \ \ \ \ \ 9423aaa Merge commit '18a737e' into dev |\ \ \ \ \ \ \ * \ \ \ \ \ \ \ 5625433 Merge commit 'afcdf74' into dev |\ \ \ \ \ \ \ \ | | | | | | | | * a95d7bf commit | | | | | | | |/ | | | | | | | * 01e20e7 commit | | | | | | |/ | | | | | | * 76ee359 commit | | | | | |/ | | | | | * 16ceaa0 commit | | | | |/ | | | | * 6d366e8 commit | | | |/ | | | * 70f1d09 commit | | |/ | | * 18a737e commit | |/ | * afcdf74 commit |/ * 8d04df7 commit What I want it to show: $ git log --graph --decorate --oneline --boundary --all * 9d4e2af (dev) Merge branch 'master' into dev |\ | * 4831cd3 (HEAD, master) commit * | 9183324 Merge branch 'master' into dev |\| | * ef35b68 commit * | 844c979 Merge commit 'a95d7bf' into dev |\| | * a95d7bf commit * | 7ffa320 Merge commit '01e20e7' into dev |\| | * 01e20e7 commit * | 8da2968 Merge commit '76ee359' into dev |\| | * 76ee359 commit * | f7dee8c Merge commit '16ceaa0' into dev |\| | * 16ceaa0 commit * | ab3d909 Merge commit '6d366e8' into dev |\| | * 6d366e8 commit * | b7e2ee9 Merge commit '70f1d09' into dev |\| | * 70f1d09 commit * | 9423aaa Merge commit '18a737e' into dev |\| | * 18a737e commit * | 5625433 Merge commit 'afcdf74' into dev |\| | * afcdf74 commit |/ * 8d04df7 commit # Let me specify which branches sink to the left. Sometimes I'm faced with a very complex mess of merges and branches. I'd like to be able to ask git log to show me the graph, but to always smash "master" to the far-left and "feature1" one column to its right. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,125 +0,0 @@ -
datagrok created this gist
Dec 6, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,125 @@ A long-running development branch periodically merges from master. To simulate, run several times: echo 1 >> 1.txt; git add 1.txt; git commit -m "commit"; git checkout dev; git merge --no-ff master; git checkout master Result: $ git log --graph --decorate --oneline --boundary --all * 9d4e2af (dev) Merge branch 'master' into dev |\ | * 4831cd3 (HEAD, master) commit * | 9183324 Merge branch 'master' into dev |\ \ | |/ | * ef35b68 commit * | 844c979 Merge commit 'a95d7bf' into dev |\ \ | |/ | * a95d7bf commit * | 7ffa320 Merge commit '01e20e7' into dev |\ \ | |/ | * 01e20e7 commit * | 8da2968 Merge commit '76ee359' into dev |\ \ | |/ | * 76ee359 commit * | f7dee8c Merge commit '16ceaa0' into dev |\ \ | |/ | * 16ceaa0 commit * | ab3d909 Merge commit '6d366e8' into dev |\ \ | |/ | * 6d366e8 commit * | b7e2ee9 Merge commit '70f1d09' into dev |\ \ | |/ | * 70f1d09 commit * | 9423aaa Merge commit '18a737e' into dev |\ \ | |/ | * 18a737e commit * | 5625433 Merge commit 'afcdf74' into dev |\ \ | |/ | * afcdf74 commit |/ * 8d04df7 commit or if committed in different order: $ git log --graph --decorate --oneline --boundary --all --date-order ... * |\ | | * | 7ffa320 Merge commit '01e20e7' into dev |\ \ * \ \ 8da2968 Merge commit '76ee359' into dev |\ \ \ * \ \ \ f7dee8c Merge commit '16ceaa0' into dev |\ \ \ \ * \ \ \ \ ab3d909 Merge commit '6d366e8' into dev |\ \ \ \ \ * \ \ \ \ \ b7e2ee9 Merge commit '70f1d09' into dev |\ \ \ \ \ \ * \ \ \ \ \ \ 9423aaa Merge commit '18a737e' into dev |\ \ \ \ \ \ \ * \ \ \ \ \ \ \ 5625433 Merge commit 'afcdf74' into dev |\ \ \ \ \ \ \ \ | | | | | | | | * a95d7bf commit | | | | | | | |/ | | | | | | | * 01e20e7 commit | | | | | | |/ | | | | | | * 76ee359 commit | | | | | |/ | | | | | * 16ceaa0 commit | | | | |/ | | | | * 6d366e8 commit | | | |/ | | | * 70f1d09 commit | | |/ | | * 18a737e commit | |/ | * afcdf74 commit |/ * 8d04df7 commit What I want it to show: $ git log --graph --decorate --oneline --boundary --all * 9d4e2af (dev) Merge branch 'master' into dev |\ | * 4831cd3 (HEAD, master) commit * | 9183324 Merge branch 'master' into dev |\| | * ef35b68 commit * | 844c979 Merge commit 'a95d7bf' into dev |\| | * a95d7bf commit * | 7ffa320 Merge commit '01e20e7' into dev |\| | * 01e20e7 commit * | 8da2968 Merge commit '76ee359' into dev |\| | * 76ee359 commit * | f7dee8c Merge commit '16ceaa0' into dev |\| | * 16ceaa0 commit * | ab3d909 Merge commit '6d366e8' into dev |\| | * 6d366e8 commit * | b7e2ee9 Merge commit '70f1d09' into dev |\| | * 70f1d09 commit * | 9423aaa Merge commit '18a737e' into dev |\| | * 18a737e commit * | 5625433 Merge commit 'afcdf74' into dev |\| | * afcdf74 commit |/ * 8d04df7 commit