Commit graph

417 commits

Author SHA1 Message Date
carlfriedrich 8e292f710b Meta: GitHub tag action: improve regex for version matching 2022-11-24 15:00:12 +01:00
carlfriedrich fb0b22890d Meta: GitHub tag action: fix getting of HEAD tag 2022-11-24 14:59:06 +01:00
carlfriedrich f3d9d62776 Meta: GitHub tag action: pass GitLab URL as an env variable
GitHub action variables are not available in called shell scripts. They
have to be explicitly passed from the YAML file. See:
https://github.com/orgs/community/discussions/27027
2022-11-24 14:55:49 +01:00
carlfriedrich 37f21753ae Meta: change line-endings from CRLF to LF 2022-11-24 14:54:00 +01:00
Wenxuan a1d1d990ec
Merge pull request #246 from carlfriedrich/add-release-action
Automatic releases
2022-11-24 09:05:51 +08:00
carlfriedrich f0e9e4f748 Meta: Add GitHub tag action
The action is executed on every first day of a month. It checks whether
the current master is already tagged and, if not, creates a new release
tag.
2022-11-23 19:02:01 +01:00
carlfriedrich eedf3ae890 Meta: Add GitHub release action
The action is executed on every tag and creates a GitHub release. The
release contains a .tar.gz asset and a changelog consisting of all
commit messages since the previous tag. Commits with a commit message
starting with "Meta" are excluded from the changelog.
2022-11-23 17:42:42 +01:00
Wenxuan Zhang fe4ac0f9f2
ci: update stale config
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
2022-11-15 15:46:34 +08:00
Tim 2872548075
GitHub actions: update to Ubuntu 22.04 (#240)
The Ubuntu 18.04 CI image is deprecated:
https://github.com/actions/runner-images/issues/6002

Switch to the new 22.04 image instead.
2022-10-14 16:05:53 +02:00
Tim 089853173e
Do not "set -e" in standalone forgit (#238)
Setting the error option in bash bypasses error handling in the forgit
functions, because the script immediatley exits in case of an error.
Remove the option to make error handling possible.
Bash scripts automatically return the exit code of the last statement,
so standalone forgit will still return useful error codes.
2022-10-08 00:43:47 +02:00
Tim 25789d2198
Fix function call in standalone forgit (#239)
From the standalone forgit command we call the according forgit function
by replacing a '_' with '::'. Since we have more complex function names
like 'forgit::cherry:⛏️:from::branch' we have to replace ALL
instances of '_' instead of just the first one.
2022-10-04 12:47:23 +02:00
Tim 49579b2d1f
Do not return an error in log, diff and stash show (#236)
fzf has the following exit codes:
0      Normal exit
1      No match
2      Error
130    Interrupted with CTRL-C or ESC

The forgit functions "log", "diff" and "stash show" are designed to
display information, not to perform any action. Hence the fzf exit code
130 should not be interpreted as an error, it is normal exit behavior.
Exclude this error value and return 0 in this case.
2022-09-17 18:16:30 +02:00
Tim e0ca1f4045
Add ability to checkout existing branch with gcb (#234)
Port @cjappl 's changes of #232 / d4b4ce3 to zsh/bash.

gcb can now be called with an existing branch as an argument.
2022-09-13 07:38:32 -07:00
Wenxuan 2a96f287a9
Merge pull request #228 from carlfriedrich/interactively-select-branch-in-gcp
Interactively select branch in gcp
2022-09-13 10:32:18 +08:00
Chris Apple 3f50933f04
Add ability to checkout existing branch with gcb in fish (#232) 2022-08-16 09:56:33 -07:00
Chris Apple bdef69083c
Adding wraps to fish - adding way to gcb an existing branch (#231)
I added a bunch of "wraps" commands to our functions. This is basically a quick and easy way to get function completion for free. Users can now tab complete most commands that take an argument
2022-08-16 09:49:22 -07:00
Wenxuan 85bc57a15c
Merge pull request #226 from carlfriedrich/support-stashes-in-gd
Support stashes in forgit::diff
2022-08-15 10:13:34 +08:00
Wenxuan e78562250f
Merge pull request #225 from carlfriedrich/add-forgit-enter-pager
Add variable FORGIT_ENTER_PAGER
2022-08-15 10:06:43 +08:00
ccoVeille f6040b21a0
fix typo in comments and README files (#230) 2022-08-09 19:07:59 -07:00
carlfriedrich b9c0e7b58f gcp: interactively select target branch
When we want to perform a cherry pick, we had to pass the target branch
as an argument to gcp. Forgit, however, aims to make git selections
interactive where possible. Hence it seems natural to select the target
branch interactively as well.
2022-08-06 19:30:49 +02:00
carlfriedrich 1e080b0e72 Introduce variable "forgit_log_preview_options"
This reduces code duplication.
2022-08-03 18:08:55 +02:00
carlfriedrich c167918098 Support stashes in forgit::diff
Git stashes are named "stash@{x}", which contains the fzf placeholder
"{x}". In order to support passing stashes as arguments to forgit::diff,
we have to prevent fzf from interpreting this substring by escaping the
opening bracket.
2022-08-03 09:24:25 +02:00
carlfriedrich 25e1a2e277 Add variable FORGIT_ENTER_PAGER
The pager used on fzf enter key binding commands was hardcoded to
"LESS='-r' less". Transfer this to a variable in order to reduce code
duplication and make it configurable.
2022-08-01 13:39:47 +02:00
zhangwenxuan.917 85ccdd3f80 fix: make linter happy 2022-07-28 16:29:49 +08:00
Wenxuan 76b5d5cc86
Merge pull request #223 from carlfriedrich/rebase-on-parent
grb: rebase on parent of the selected commit
2022-07-28 16:24:31 +08:00
carlfriedrich 126772f08c Add function forgit::previous_commit 2022-07-28 10:16:22 +02:00
carlfriedrich d343300625 grb: rebase on parent of the selected commit
The git rebase command needs to be passed the parent commit of the one
you want to edit. When selecting a commit interactively via fzf, it
makes sense to automatically pass the parent commit of the selected one.
Within fzf it's otherwise quite hard to find the parent commit by hand
if you have found your commit via an fzf search string.
2022-07-28 10:14:37 +02:00
Wenxuan bd7942f6f7
Merge pull request #222 from carlfriedrich/add-variable-forgit-extract-sha
Add variable "forgit_extract_sha"
2022-07-28 14:42:56 +08:00
carlfriedrich 7b1ebff09f Add variable "forgit_extract_sha"
This reduces code duplication. We cannot implement this as a function,
because fish and zsh do not support exporting functions, but we need it
in subshells (see https://github.com/fish-shell/fish-shell/issues/6961).
Implement it as a variable in all shells instead.
2022-07-26 09:21:42 +02:00
Wenxuan 041bc9a377
Merge pull request #221 from carlfriedrich/improve-forgit-diff
Improve forgit::diff
2022-07-26 09:31:16 +08:00
carlfriedrich 8d3ecb6ccf Add variables for diff context
Introduce FORGIT_DIFF_CONTEXT for the diff context when viewing a diff
and FORGIT_PREVIEW_CONTEXT for the diff context in the preview window.
2022-07-22 14:26:08 +02:00
carlfriedrich bb4514a359 Improve forgit::diff
* Show additional context on enter compared to preview
* Show selected diff range in fzf prompt
2022-07-17 16:42:11 +02:00
Chris Apple bd8fce74a6
Fish didn't like the tac/tail switch. Also removed some print statements (#220) 2022-07-14 19:05:09 -07:00
Chris Apple 6ce2c25490
Fish: Fix GA and GD when there is whitespace in the name (#209) 2022-07-14 09:25:51 -07:00
Tim fdd5632b17
Fix cherry pick preview (#218)
The preview on cherry pick was accidentally broken since we included the
+/- information in the commit list. Fix this by using the correct string
index.
2022-07-14 09:24:56 -07:00
Wenxuan d2c2848037
Merge pull request #216 from carlfriedrich/improve-cherry-pick
Improve cherry-pick
2022-07-14 08:41:24 +08:00
carlfriedrich fe5c4d9881 Reverse order on cherry pick
Git log displays the newest commits on top of the list, while git cherry
pick displays the newest commits at the bottom. Reverse the order of
git cherry pick so that it has the same order like git log.
2022-07-13 12:33:55 +02:00
carlfriedrich 1b7db0fb6e Preserve +/- information on cherry pick
The output of 'git cherry' which is used to build the fzf input list for
forgit::cherry::pick usually prefixes every line with a '-' for commits
that have an equivalent in the target branch, and a '+' for commits that
do not.

Previously forgit removed this information from the list. However, for
the actual cherry-picking process this information is relevant, so we
should keep it.
2022-07-12 16:42:18 +02:00
carlfriedrich 52d79009d1 Preserve commit order on cherry pick
When using a fzf find string which maches multiple lines, the commits
could appear in a wrong order. Add "--tiebreak=index" to ensure that the
correct commit order is preserved.
2022-07-12 16:35:54 +02:00
carlfriedrich 53d0ea2f38 Add FORGIT_CHERRY_PICK_FZF_OPTS
The gcp (git cherry pick) command was the only command which did not
have a variable to set command-specific fzf options. Add the according
variable to source code and documentation.
2022-07-12 16:35:54 +02:00
Wenxuan 98a5cc27a1
Merge pull request #211 from sandr01d/gb
Feature: Added interactive git blame
2022-06-17 22:14:12 +08:00
sandroid f8b1fc8545
Changed alias for forgit::blame to gbl 2022-06-16 22:34:13 +02:00
Wenxuan 3506cfc365
Merge pull request #213 from ibayramli2001/fig
Add Fig as an installation method to the README
2022-06-16 09:31:46 +08:00
Ilkin Bayramli f1305dbdb0
Add Fig as an installation method to the README 2022-06-15 15:15:14 -07:00
sandroid 2d3dd568bb
gb: handle untracked files 2022-06-03 23:24:40 +02:00
sandroid 958e26add5
Added gb 2022-06-02 23:22:41 +02:00
Wenxuan 6385f85360
fix: gd show empty preview when path has spaces in zsh/bash (#204) 2022-05-28 17:04:23 -07:00
Wenxuan Zhang 544cf86bc4
docs: update comment 2022-05-20 17:44:51 +08:00
Chris Apple 75e9d12bac
Adding support for git branch delete method (#200)
* Adding support for git branch delete method in fish

* Add new doc to README

* Added options like gcb

* refactor: remove `--all` flag from gbd

* feat: sync forgit::branch::delete to bash and zsh

Co-authored-by: Wenxuan Zhang <wenxuangm@gmail.com>
2022-05-11 09:41:21 -07:00
Wenxuan 0c4a3069ba
Merge pull request #199 from max-ae/fix/gd-spaces
fix: `forgit::diff` not working if repo path contains spaces
2022-05-10 10:02:04 +08:00