-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new feature: import/export marked commit lists #915
base: master
Are you sure you want to change the base?
Conversation
BP is short for BackPort. When you need to do a lot of backporting it is useful to be able to mark/unmark and load/save lists of commits. Currently tig has one global bplist, but the implementation is generic enough and works on bplist instances so that in the future we could have multiple bplist. * bplist_init(): initialize a bplist * bplist_read(): load a bplist from a file into an initialized bplist * bplist_has_rev(): checks whether a bplist contains a commit rev * bplist_add_rev(): adds a rev to a bplist if it is not already there * bplist_rem_rev(): removes a rev from a bplist if it holds it * bplist_toggle_rev(): adds/remove rev from a bplist * bplist_write(): dump a bplist to a file A bplist file is a plain text file where each line is in the form of <sha1>[ <text>] Lines who do not match this format will be added as-is and not be considered as commit. When writing a bplist, commits are sorted by commit date. Non-commit lines get a commit date of 0 and they end up at the top of the line as a result.
* initialize the bplist in main() before parsing options * add -l to load a bplist file or specify a file to save to on exit * handle -lfoo and -l foo * write bplist on exit if a file was specified
adds main-bp-mark line style option.
I came here just to say this is exactly the feature I'm looking for! My dev workflow is somewhat messy, and tends to be At the moment a is cmdline, c I actually use tig (previously to get the sha1, but now I found I can usefully bind a command), but (b) is a fairly rote 'git rebase -i'. I think someone else was after a 'mark this commit so I can trigger a diff against it with a different commit' which would also be of interest. |
An alternative to this PR could be (with tig 2.5.0):
|
When doing large backports or similar work that involves a lot of
cherry picking, it can be useful to maintain lists of commits. While
in the main view, Tig can mark commits via the toggle-bp-mark action,
which is bound to C-b by default. Marked commits title will be
displayed using an alternative style (main-bp-mark).
If a path is specified when running Tig (see
-l
option). Tig canread and write marked commits. Tig tries to import that file on
startup if it exists, and writes to that file on exit.
The format of this file is simple, each line must have the following format:
Tig tries to keep the content of each line when it imports
it. Additional commits added during the Tig session will use the
commit title as text when exporting.
On exit, Tig sorts the marked commits by commit date (not author date)
and exports the marked lists to the file specified by the
-l
option.-l
to specify location to import/export marked list toCurrently tig has one global bplist, but the implementation is generic
enough and works on bplist instances so that in the future we could
have multiple bplists.
A bplist holds a list of lines and a hashtable that maps fully-expanded revs to lines.