Skip to content

rebase: teach `--exec` about `GIT_REBASE_BRANCH`

Kristoffer Haugsbakk git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1rebase: teach `--exec` about `GIT_REBASE_BRANCH`Documentation/git-rebase.txt builtin/rebase.c t/t3409-rebase-environ.sh+37 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] rebase: teach `--exec` about `GIT_REBASE_BRANCH`

The following patch adds an env. variable for the branch name that we were on before the rebase operation started. This is for use by --exec <cmd>.

The need for fetching the branch name came up while making a script for --exec and it seemed that parsing the name out of the first line of git branch --list was the best approach.

I thought that was inconvenient. Why not an environment variable set by git-rebase(1)? (open question)

See: https://stackoverflow.com/a/50124157/1725151

§ Implementation

The implementation is inspired by
builtin/branch.c:print_current_branch_name.

Kristoffer Haugsbakk (1):
rebase: teach --exec about GIT_REBASE_BRANCH

 Documentation/git-rebase.txt |  4 ++++
 builtin/rebase.c             | 15 ++++++++++++++-
 t/t3409-rebase-environ.sh    | 19 +++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
Signature · 1 line
2.44.0.64.g52b67adbeb2