git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Kristoffer Haugsbakk <code@khaugsbakk.name>
Date
Mar 3, 2024, 20:03 UTC
Message-ID
<cover.1709495964.git.code@khaugsbakk.name>

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: Kristoffer Haugsbakk
Message 1 of 5 in “rebase: teach `--exec` about `GIT_REBASE_BRANCH`”
  1. 0/1 rebase: teach `--exec` about `GIT_REBASE_BRANCH`Kristoffer Haugsbakk, Mar 3, 2024
  2. 1/1 rebase: teach `--exec` about `GIT_REBASE_BRANCH`Kristoffer Haugsbakk, Mar 3, 2024
  3. Junio C HamanoMar 3, 2024
  4. Phillip WoodMar 4, 2024
  5. Kristoffer HaugsbakkMar 7, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.