`glog` is the most standalone tool out of my dotfiles and I know of at
least one person that uses it that way. Because of this I want to also
explicitly map all other bindings that I have in my zprofile to improve
the experience.
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.
When an argument is passed that does not exist, `ls` always prints the
directory name for the existing ones, even if there is only one
remaining directory that is listed.
`ls` prints a warning if a non-flag argument is specified that does not
exist.
Previously ls-show-hidden assumed that all arguments that are neither a
directory nor an otherwise existing file are flags. As all flags are
passed to the ls call the warning still got printed, but this also lead
to the current working directory (i.e. `.`) being added to the
directories to process.
If `ls` expects an argument to a flag, it is always passed in the format
`--flag=arg` where the equal sign is mandatory. This makes it possible
to simply filter out all flags (and their arguments) from the other
arguments without needing to know which flags take an argument and which
don't.
Fix this behaviour by printing the same warning as `ls` does when an
argument is neither a flag, nor a directory nor an existing file. Also
only add `.` to the directories if *really* only flags were passed.
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`.