|
2 | 2 |
|
3 | 3 | ## How do I get Flog to run faster? |
4 | 4 |
|
5 | | -There are several ways to get Flog to run faster depending on what your exact issue is. |
| 5 | +The answer depends on your issue. |
6 | 6 |
|
7 | | -**Specifying the max count** |
| 7 | +**Flog is slow the first time it runs for a repo** |
8 | 8 |
|
9 | | -You may want to specify `-max-count=<count>`, or use `let g:flog_default_arguments = { 'max_count': <count> }`. |
| 9 | +The first time Flog runs for a repo, it runs `git commit-graph write`. |
| 10 | +This ultimately makes it run faster. |
10 | 11 |
|
11 | | -This restricts the log to displaying a certain number of commits. |
12 | | -This will increase the speed at which Flog can redraw the commit graph, generally reducing lag. |
13 | | - |
14 | | -If you need to jump forward/backwards in history by `<count>`, use `[[`/`]]` |
15 | | - |
16 | | -**Pre-calculating the commit graph** |
17 | | - |
18 | | -In very large repositories, the commit graph can take a long time to sort when you use `git log --graph` or run Flog, even with max count specified. |
19 | | -In these cases you can pre-calculate the commit graph. |
20 | | - |
21 | | -If you are running Git 2.24 or greater, it is enabled by default. |
22 | | -Otherwise it can be enabled via: |
| 12 | +Disable this feature: |
23 | 13 |
|
24 | 14 | ``` |
25 | | -git config --global core.commitGraph true |
26 | | -git config --global gc.writeCommitGraph true |
| 15 | +let g:flog_write_commit_graph = 0 |
27 | 16 | ``` |
28 | 17 |
|
29 | | -After that, navigate to your repository and run `git commit-graph write`. |
30 | | - |
31 | | -This command may still take a long time to run, but once it has been generated, `git log --graph` and Flog will run much faster. |
32 | | -If you don't plan to view a large number of commits that aren't reachable, you can use `git commit-graph write --reachable` to speed up this process. |
| 18 | +Set args (defaults shown): |
33 | 19 |
|
34 | | -You may want to re-run this command regularly when there are enough new commits. |
35 | | - |
36 | | -**Disabling graph mode** |
37 | | - |
38 | | -If you want to skip generating a graph and use Flog just as a log viewer, you can pass `-no-graph` to Flog or use the `gx` binding to toggle the graph. |
39 | | -This is equivalent to `git log --no-graph`. |
40 | | - |
41 | | -If this is still too slow, it might be because Flog has to wait until the command completes to write output to the buffer. |
42 | | -In these cases, you may want to resort to just using `git log` in the terminal. |
| 20 | +``` |
| 21 | +let g:flog_write_commit_graph_args = '--reachable --progress' |
| 22 | +``` |
43 | 23 |
|
44 | | -**Flog is still too slow** |
| 24 | +**Flog gets slower over time for repos** |
45 | 25 |
|
46 | | -Flog, unlike other branch viewers like `gitk`, is just a wrapper around `git log`. |
47 | | -It just reads static output from the command after it finishes and writes it to a buffer. |
48 | | -By contrast, `gitk` reads raw commit data, calculates the graph structure itself commit-by-commit, and updates the display, all without hanging. |
| 26 | +The commit graph will eventually become out of date. |
49 | 27 |
|
50 | | -This may change in the future, so check back. |
| 28 | +You can update it by running: |
51 | 29 |
|
52 | | -If you have any feedback about Flog's speed or any of the suggestions above, please see [this ongoing issue](https://github.com/rbong/vim-flog/issues/26). |
| 30 | +``` |
| 31 | +git commit-graph write --reachable --progress |
| 32 | +``` |
53 | 33 |
|
54 | | -## How do I get Flog to look nicer? |
| 34 | +**Flog takes a long time to load for many commits** |
55 | 35 |
|
56 | | -Flog struggles with highlighting since Vim is not built to highlight vertical columns. |
| 36 | +By default, Flog will shows 5,000 commits. |
57 | 37 |
|
58 | | -To use the same highlighting that `git log --graph` would use in the shell, |
59 | | -[download the AnsiEsc.vim plugin](https://github.com/vim-scripts/AnsiEsc.vim), |
60 | | -then add `let g:flog_use_ansi_esc = 1` to your `.vimrc`. |
| 38 | +Launch with less commits: |
61 | 39 |
|
62 | | -Note that using `AnsiEsc.vim` with Flog comes with a performance hit. |
| 40 | +``` |
| 41 | +:Flog -max-count=2000 |
| 42 | +``` |
63 | 43 |
|
64 | | -Another option is to use a custom command to replace `git log --graph`. |
65 | | -Some users prefer the look of [git-forest](https://github.com/rbong/git-scripts/blob/master/git-forest), |
66 | | -pictured below. |
| 44 | +Launch with less commits by default: |
67 | 45 |
|
68 | | - |
| 46 | +``` |
| 47 | +let g:flog_permanent_default_opts = { 'max_count': 2000 } |
| 48 | +``` |
69 | 49 |
|
70 | | -To use `git-forest` as a custom log command, |
71 | | -[download it from here](https://github.com/rbong/git-scripts/blob/master/git-forest), |
72 | | -and add it to your path, then add this to your `.vimrc`. |
| 50 | +**Flog takes a long time to load for complex git branch graphs** |
73 | 51 |
|
74 | | -```vim |
75 | | -let g:flog_build_log_command_fn = 'flog#build_git_forest_log_command' |
76 | | -``` |
| 52 | +Toggle the graph with `gx` or launch with `:Flog -no-graph`. |
77 | 53 |
|
78 | | -## Why not just use the `git log --graph` command? |
| 54 | +**Other issues** |
79 | 55 |
|
80 | | -To interact with commits. |
| 56 | +Please [post an issue](https://github.com/rbong/vim-flog/issues/). |
81 | 57 |
|
82 | | -## Why have a branch viewer inside of Vim? |
| 58 | +## What are the differences with other branch viewers? |
83 | 59 |
|
84 | | -This allows seamlessly switching between navigating the commit history, running git commands, and editing files checked into git. |
| 60 | +[gv.vim](https://github.com/junegunn/gv.vim) is an ultra-light branch viewer. |
85 | 61 |
|
86 | | -It also prevents having to learn another git interface on top of [fugitive](https://github.com/tpope/vim-fugitive). |
| 62 | +[gitv](https://github.com/gregsexton/gitv) is a fully featured branch viewer. |
87 | 63 |
|
88 | | -If you want to know everything you can do with fugitive, I recommend [the Vimcasts fugitive series](http://vimcasts.org/blog/2011/05/the-fugitive-series/). |
| 64 | +Flog is faster than gitv. |
| 65 | +Flog is slower than gv.vim, but in many cases only marginally. |
89 | 66 |
|
90 | | -## What are the differences with other branch viewers? |
| 67 | +gv.vim and gitv rely on the output of `git log --graph`. |
| 68 | +Flog draws the git branch graph itself. |
| 69 | +This allows for branch highlighting and beautiful git branch graphs. |
91 | 70 |
|
92 | | -[gv.vim](https://github.com/junegunn/gv.vim) is an ultra-light branch viewer, whereas Flog is fully featured. |
93 | | -Flog allows updating the graph, running commands, and customization, where gv does not. |
| 71 | +Flog is more customizable and flexible than gitv. |
| 72 | +gv.vim does not have any customization or flexibility by design. |
94 | 73 |
|
95 | | -[gitv](https://github.com/gregsexton/gitv) is another fully featured branch viewer. |
96 | | -Flog is a next generation branch viewer that learns a lot of lessons from gitv. |
97 | | -It has a better defined argument system, more robust window management, more stable update system, has the ability to run more commands in the graph easier, has cleaner mappings, and supports any log format. |
| 74 | +Flog has features which have no equivalent in either of the other branch viewers. |
| 75 | +This includes commit marks, some navigation mappings, and contextually aware command completion. |
98 | 76 |
|
99 | 77 | ## How can I learn how to use flog? |
100 | 78 |
|
101 | 79 | See `:help flog` for all commands and options. |
102 | | -See [the examples](EXAMPLES.md) for detailed walkthroughs of different operations using flog. |
103 | | -Please [post an issue](https://github.com/rbong/vim-flog/issues) if you have any questions on how to do anything. |
| 80 | +See [examples](EXAMPLES.md) for detailed walkthroughs. |
| 81 | +Please [post an issue](https://github.com/rbong/vim-flog/issues) if you have any questions. |
0 commit comments