Skip to content

Commit c50cded

Browse files
committed
2 parents be89609 + 3c52eae commit c50cded

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

README.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,20 @@ git commit -m 'master - third'
183183
You can verify the repo structure using something like `git log`.
184184
```bash
185185
$ git log --graph --oneline --decorate --all
186-
* 7fd1f5d (HEAD -> master) master - third
187-
| * 98b994f (branchB) branchB - seventh
188-
| * 00dda04 branchB - sixth
189-
| * 01895af branchB - fifth
190-
| * 84fa67d branchB - fourth
191-
| * f8e33ec branchB - third
192-
| * 7b66d32 branchB - second
193-
| * 3385e18 branchB - first
186+
* da0165b (HEAD -> master) master - third
187+
| * 8e3cf50 (branchB) branchB - seventh
188+
| * e0420c1 branchB - sixth
189+
| * f51497b branchB - fifth
190+
| * cee652e branchB - fourth
191+
| * 2fc95e6 branchB - third
192+
| * 9c654d8 branchB - second
193+
| * 33fbc07 branchB - first
194194
|/
195-
| * cced7be (branchA) branchA - second
196-
| * 843d5ce branchA - first
195+
| * 20ea3d2 (branchA) branchA - second
196+
| * 71a0d0c branchA - first
197197
|/
198-
* 46407c4 (tag: v1.0a, tag: v1.0, branchX2, branchX1) master - second
199-
* 84ca47b master - first
198+
* ecdc7dc (tag: v1.0a, tag: v1.0, branchX2, branchX1) master - second
199+
* c8ae444 master - first
200200
```
201201

202202
Now run the git2dot tool to generate PNG, HTML and SVG files.
@@ -237,16 +237,27 @@ $ python -m SimpleHTTPServer 8090
237237

238238
After that you can browse to http://localhost:8090/example.html and you will see this.
239239

240-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://cloud.githubusercontent.com/assets/2991242/22406665/d5f7ca60-e60b-11e6-957f-ff6a9536b615.png" width="1100" alt="example">
240+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://cloud.githubusercontent.com/assets/2991242/22431235/b585cf7e-e6c5-11e6-8f17-6b99847bfe51.png" width="1100" alt="example">
241241

242-
As you can see, there is a long chain of commits, to run it again using the squash option.
242+
As you can see, there is a long chain of commits, to run it again using the `--squash` option.
243243

244244
```bash
245245
$ git2dot.py --squash --png --svg --html example1.html example1.dot
246246
```
247247

248248
And browse to http://localhost:8090/example1.html and you will see this.
249249

250-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://cloud.githubusercontent.com/assets/2991242/22406722/df2c38ae-e60c-11e6-91a8-6890e513cb36.png" width="1100" alt="example1">
250+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://cloud.githubusercontent.com/assets/2991242/22431252/c5077344-e6c5-11e6-95b0-54cd02d11aa2.png" width="1100" alt="example1">
251251

252252
Which is a cleaner view of the overall structure.
253+
254+
You will also note that there are two branches and two tags on *ecdc7dc*. They can be collapsed using the `--crunch` option like this.
255+
256+
```bash
257+
$ git2dot.py --crunch --squash --png --svg --html example1.html example1.dot
258+
```
259+
When you browse to http://localhost:8090/example2.html and you will see this.
260+
261+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://cloud.githubusercontent.com/assets/2991242/22431258/c89d7e7c-e6c5-11e6-826e-cf7450b9f125.png" width="1100" alt="example2">
262+
263+
For such a small graph the crunch operation doesn't really make things simpler but for larger graphs where dot may move the branch and tag information around, it can be a much cleaner view.

0 commit comments

Comments
 (0)