Commit Graph

113 Commits

Author SHA1 Message Date
740c0b2fd7 git: Add git-abort & git-continue
I find typing `git {rebase,merge,...} --{continue,abort}` a bit
annoying, since it is a lot of typing. I have added an alias for `rebase
--continue` (grc), but the problem remained for the other commands.

Add a script that continues or aborts the ongoing process by detecting
it automatically.
2025-06-19 14:03:17 +02:00
3d3ba75abb git: Use commit.template for a 2nd newline
When I write commit messages in vim, I often use gwap to format the
message body. This breaks if there is no empty line between the body and
the following "Please enter the commit message for your changes..."
comment.

So, to not always have to add this empty line first, I use a
commit.template file that simply contains one empty line.
2025-05-28 14:05:39 +02:00
e9f05d5d08 git: Add ls -> ls-files alias 2025-05-23 18:19:38 +02:00
bbc6d5c9e0 git: Fix working directory of shell aliases
In git aliases, shell commands are executed from the top-level directory
of the repo. Because of this, something like `git glog -- file` didn't
work in subdirectories.

Fix this by creating a wrapper script that first changes into
$GIT_PREFIX before executing the script. Since (currently) the only
use-case is to launch the functions in `autoload/git/`, most of the path
could move into the script, making the git config a lot cleaner.
2025-05-23 16:30:58 +02:00
9bf853a8d2 git: Fold sections in vim via modeline 2025-05-23 13:33:02 +02:00
7158abd611 git: Reorder aliases
Bring all blocks together and place shorter alias variants behind longer
ones - ignore the shorter ones in the sorting.

Remove the comment above `autosquash` because the command is fairly
descriptive and it is the only comment and I don't really know how to
format the block then (since the comment is at the very top it looks
like it is for the whole block and I don't want to put a newline behind
`autofixup`).
2025-05-23 13:19:25 +02:00
fc60d4baf3 git: Add fetch-tags-only alias 2025-05-23 13:08:24 +02:00
5b36728e07 git: Add indent-with-non-tab to core.whitespace
The rest was already enabled by default.
2025-04-30 17:03:05 +02:00
99d8b6133c git: Set trailer.where = end
Don't remember why I had to set it, or what problems I had without
(since it should be the default, no?), but does no harm.
2025-03-25 18:13:54 +01:00
f77b7b7ff6 git: Switch back to diff-so-fancy from delta
I'm not happy with the colors and diff-so-fancy is easier, since it's
just shipped with this repo via a submodule.
2025-03-25 18:08:22 +01:00
52264362f3 *: Update email 2025-03-20 23:02:31 +01:00
ca1483052b git: Set filetype in modeline
Github does not highlight syntax otherwise.
2024-11-06 13:29:48 +01:00
d30b102e42 git: Set merge.conflictstyle to diff3
Display original text in addition to changes from both sides.
2024-09-21 00:03:34 +02:00
ea2a02626d git: Test delta as diff-so-fancy replacement
Don't know yet if I like it better
2024-09-21 00:03:01 +02:00
9e19a19f76 git:alias: Fix sorting 2024-09-21 00:02:00 +02:00
7aee885ce8 git:alias: Fix flog -> glog typo
I never really use this but instead `glog` directly, but still.
2024-09-21 00:01:52 +02:00
48d2ccec6c git: Update email address 2024-07-25 22:24:35 +02:00
96de70a433 git:column: Fill columns before rows
This is way easier to parse even if it means that I have to potentially
scroll more.
2024-05-24 10:44:55 +02:00
15af1af190 git: Output in columns
Supported git commands should print their output in columns (e.g.
git-branch).

I am still unsure if I'd like to keep the option to fill rows first. The
default behaviour is columns first and `ls` does this too for example.
But I think that it makes more sense to fill the rows first, especially
with sorting by committerdate to delay the need to scroll as far as
possible.
2024-04-09 15:22:17 +02:00
b6cfd9c74a git: Sort branches by reverse committerdate 2024-04-09 15:22:17 +02:00
fc7aad6c1e git: Set diff.colorMovedWS to ignore-all-space
In addition to `diff.colorMoved` this controls how whitespace changes
should affect the detection of moved lines.
2024-03-07 12:31:14 +01:00
6c545ab8b0 git:alias: Add recommit and last-msg 2024-01-29 04:17:17 +01:00
700c661e04 git:alias: Add clm for commit-last-msg 2024-01-25 17:45:00 +01:00
4fceae683f git: Turn on diff.colorMoved 2023-11-18 13:36:34 +01:00
d38ee159ed git: Add perm-stash to save a stash to a file 2023-07-18 14:30:09 +02:00
3ecea7923a git: Disable renameLimit
I want all the renames pls
2023-07-10 16:33:34 +02:00
c83c793a1a git: Disable fetch.pruneTags
This leads to problems in repositories with multiple remotes that do not
share the same tags. A fetch --all will then fetch and delete a tag at
the same time. Tags are also way less often deleted in my experience so
that an automatic pruning is not necessary.
2023-07-09 00:03:44 +02:00
51249568ce git:interactive.diffFilter: Activate diff-so-fancy
This reverts commit 43bf8801f9.

diff-so-fancy was disabled as the interactive diff-filter in
43bf8801f9 ("git:interactive.diffFilter: Disable diff-so-fancy")
because of the rewrite in C of `git add -p`.

This was fixed in v2.38.0[^1].

[^1]: https://github.com/git/git/blob/v2.38.0/Documentation/RelNotes/2.38.0.txt#L353-L356
2023-02-24 10:45:14 +01:00
05f2857d3c git: Add installation note for Term::ReadKey 2023-02-24 10:22:45 +01:00
25243e5ee6 git:last-changed: Fix execution in subdir
git aliases are executed in the repository root.

Fix the output of git-last-changed by first cd-ing into the current
working directory.
2023-02-13 16:37:05 +01:00
805180be5d git:alias: Reorder auto{squash,fixup}
As the flag is called `--autosquash`, the order makes more sense like
this.
2023-01-17 16:34:05 +01:00
f317ed81c2 git: Add last-changed to mimic github file browser
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.
2023-01-17 01:38:17 +01:00
73c0864c8b git: Add https-and-ssh to setup origin
Sets up origin so that it fetches over https but pushes over ssh. This
way unlocking the ssh key is only needed when really necessary.
2022-12-01 01:27:28 +01:00
d99118646c git:alias: Add more short-hands 2022-10-20 16:40:16 +02:00
861b159c78 git:alias: Add multiple short-hand versions 2022-10-20 16:39:23 +02:00
e15fc71054 zsh,git: Add git-make-fork 2022-10-17 17:28:31 +02:00
0ad0ccb0c8 git: Make commit-last-msg available as alias
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`.
2022-08-30 19:52:24 +02:00
43bf8801f9 git:interactive.diffFilter: Disable diff-so-fancy
Disable diff-so-fancy as `interactive.diffFilter` for now, as it is
incompatible with git version `v2.37`.[1]

[1] - https://github.com/so-fancy/diff-so-fancy/issues/437
2022-07-12 21:00:12 +02:00
e949ffefef git: Set interactive.singleKey
In interactive commands, allow the user to provide one-letter input with
a single key (i.e., without hitting enter). Currently this is used by
the --patch mode of git-add(1), git-checkout(1), git-restore(1),
git-commit(1), git-reset(1), and git-stash(1). Note that this setting is
silently ignored if portable keystroke input is not available; requires
the Perl module Term::ReadKey.[1]

[1] - git-config(1)
2022-07-12 21:00:12 +02:00
0faf19ad3d git:alias: Add git-submodule-rm for function
Just add a git alias to the already existing zsh function to make it
easier to call it.
2022-07-12 21:00:09 +02:00
13ebd97d8e git: Set interactive.diffFilter to diff-so-fancy
Pipe patches through diff-so-fancy in interactive commands (e.g. `git
add -p`) too.
2022-07-12 21:00:03 +02:00
d136658888 git: Update alias section
Move `signoff` out of the 'external' subsection as the script [got
replaced by the native way][1].

Update 'external' subsection's comment as it does not contain only zsh
functions.

[1]: bb21c4df7844 ("git: Replace git-signoff with `rebase --signoff`")
2022-07-12 21:00:02 +02:00
03163a92a4 git:filter-repo: Add to $PATH 2022-07-12 21:00:02 +02:00
09ef4d4d93 git: Replace git-signoff with rebase --signoff
Replace my custom git-signoff script with the native `--signoff` flag
for `git rebase`.
2022-07-12 21:00:00 +02:00
ac0987719f git:submodule: Parallel with a reasonable amount
Git should decide on a reasonable default for how many fetch/clone jobs
should run in parallel.
2022-07-12 21:00:00 +02:00
3512199fce git:spull: Rename to ssync
As I rarely use git-pull(1) and instead fetch and act manually, I'd
rather have it to just sync the submodules.
2022-07-12 20:59:59 +02:00
706c55acc1 git:alias: Reorder zsh functions into own block 2022-07-12 20:59:59 +02:00
c22fcf5fce git,zsh:autoload: Move spull into own function
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.
2022-07-12 20:59:59 +02:00
0146956dd4 git:core.pager:,less: Use long flag variants 2022-07-12 20:59:59 +02:00
c86b1b765a git:core.pager: Update flags
Remove `-g` as it was put in place for a better experience with the
search pattern that `less` was started with.

Readd `-F` as it was explicitly unset when the search pattern was
introduced.

Do not readd `-X` as I like output that is too long (e.g. `log`, `show`)
to be kept in alternate mode and out of my scrollback buffer.

See:

- 17433d0528 ("git:core.pager: Remove the search pattern")

> This gets really annoying as it complains in many cases that it cannot
> find a match for the pattern when the pager is used for other things
> than commits.

- 093c3a6f9c ("git: Highlight current match in pager")

- 7e0e0f5baf ("git: Enable jumps between different files in diff")

> Jump between file sections and commits by using n and N. Taken from:
> https://github.com/so-fancy/diff-so-fancy/blob/eef379ee43f/pro-tips.md
>
> Remove FX flags since they are incompatible with the pattern search:
> When showing a small change that fits on less than the screen height,
> the rest of the screen is filled with ~ lines instead of quitting the
> pager. This behaviour is annoying and thus the flags are deactivated.
> Since git adds them per default they have to be explicitly disabled.
2022-06-23 23:59:02 +02:00