From: Kristoffer Haugsbakk <code@khaugsbakk.name>
To: git@vger.kernel.org
Cc: Kristoffer Haugsbakk <code@khaugsbakk.name>
Subject: [PATCH 0/1] rebase: teach `--exec` about `GIT_REBASE_BRANCH`
Date: Sun, 3 Mar 2024 21:03:36 +0100 [thread overview]
Message-ID: <cover.1709495964.git.code@khaugsbakk.name> (raw)
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(-)
--
2.44.0.64.g52b67adbeb2
next reply other threads:[~2024-03-03 20:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-03 20:03 Kristoffer Haugsbakk [this message]
2024-03-03 20:03 ` [PATCH 1/1] rebase: teach `--exec` about `GIT_REBASE_BRANCH` Kristoffer Haugsbakk
2024-03-03 23:24 ` Junio C Hamano
2024-03-04 9:56 ` Phillip Wood
2024-03-07 15:18 ` Kristoffer Haugsbakk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1709495964.git.code@khaugsbakk.name \
--to=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).