Due to the formatting placeholders sitting on the previous line, the
coloring of the topmost line disappeared when scrolling (as the escape
sequence scrolled away). This had the background that I wanted the code
that sets up the format string to be very readable and if possible very
close to the actual output. And since the colors have all different
lengths I decided to place them on the previous line to have them out of
the way.
Fix this by placing the placeholders on the same output line while still
maintaining a readable format string (code). This is done by joining the
array without placing newlines so that it can now have multiple elements
for one output line and formatting those as wished.
Switch to using the `change-preview()` action that was introduced in
0.29.0 (which was actually not yet released for a year when this feature
was first written). The old `preview()` is a one-off action while
`change-preview()` changes the `--preview` option.
This had the downside that when changing to a different preview and
moving to the next commit one would had to repeat the change. This was
especially annoying when looking through the history of a file that was
renamed. With the commit that renamed the file all previous commits
broke in the `files_only` preview as the path didn't exist yet (A
possible but probably pretty hard TODO to fix).
TODO: glog: Fix files_only preview for renamed files or give prompt to
change the paths
I am still unsure if I want the author or committer name. For the date I
think it makes sense to have the committer date since it reflects better
when the branch last changed.
When setting up the remotes the fetch url can use https since the fork
will be public anyways. This delays a prompt for the ssh key until it is
really necessary.
Use core.commentchar to identify commented lines and use the cut line
instead of just deleting from the first comment on, as this would break
for example in git generated messages (e.g. squashes).
When calling git-checkout-worktree from inside a temporary working tree
(doesn't necessary need to be a recursive call, could be another shell
too) the name would be very long.
Fix this by using the folder name of the main working tree.
When file arguments were passes behind `--`, show only these files in
the patch preview. This mimics the behaviour of `git log -up --
<files>`.
The full patch can still be displayed with ctrl-p.
`cut` counts bytes instead of printable character, making it truncate
colored lines too early.
Fix this by using awk and adding the length difference between a colored
and uncolored version to the allowed length.
COLUMNS is a shell variable and thus needs exporting for `ENVIRON` to
see it in awk.
List all files and directories but include the latest commits date and
subject, similar to the file browser in web-UIs of services like GitHub.
Also sort the entries by the commits date and time to see the most
recent changed files/folders at the bottom.
Move `git-commit-last-msg` into an autoloadable function. This way it
can also be executed as external script and thus in a git alias. This
makes it additionally possible to call it in vim over fugitive's `:Git`.
Pass all given arguments to `git worktree add`. This makes it possible
to directly create a new branch with `-b` for example. As the arguments
are not used anywhere else, this should not introduce any parsing
issues.
Update the function to use the current `.git/modules/` structure, by
only using the basename of the path.
I am not sure when this was changed and too lazy right now to find it
out.
Move `git-track` into its own autoloadable function.
This way it is better maintainable as in one-liner format and brings the
possibility of having more complexity (e.g. for better portability).
By that it is also now executable as `git-spull` as well as `git spull`
as before.
Wrap lines at 80 columns where appropriate and I had the energy to think
about how/where to wrap.
There are still lines longer than that, which I plan to wrap in the
future. But that is enough for now.
Escape slashes in the branch name before passing it to `mktemp`.
Otherwise it would complain with:
mktemp: invalid suffix [...], contains directory separator
Add description in one sentence and use cases for this.
Remove sentence about removing `TEMP_DIR` that is outdated since:
5a8b5ffd21 ("git:checkout-worktree: Use `mktemp` template")