-
Notifications
You must be signed in to change notification settings - Fork 27.9k
Comparing changes
Open a pull request
base repository: git/git
base: a7a079c2c4bc7b269229a6ea6c147b6b2d5b2684
head repository: git/git
compare: e4f9d6b0ab2e1903765258991a6265599d0007ce
- 6 commits
- 11 files changed
- 2 contributors
Commits on Mar 6, 2026
-
interpret-trailers: factor trailer rewriting
Extract the trailer rewriting logic into a helper that appends to an output strbuf. Update interpret_trailers() to handle file I/O only: read input once, call the helper, and write the buffered result. This separation makes it easier to move the helper into trailer.c in the next commit. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 8efabc9 - Browse repository at this point
Copy the full SHA 8efabc9View commit details -
interpret-trailers: refactor create_in_place_tempfile()
Refactor create_in_place_tempfile() in preparation for moving it to tralier.c. Change the return type to return a `struct tempfile*` instead of a `FILE*` so that we can remove the file scope tempfile variable. Since 076aa2c (tempfile: auto-allocate tempfiles on heap, 2017-09-05) it has not been necessary to make tempfile varibales static so this is safe. Also use error() and return NULL in place of die() so the caller can exit gracefully and use find_last_dir_sep() rather than strchr() to find the parent directory. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 876b2eb - Browse repository at this point
Copy the full SHA 876b2ebView commit details -
trailer: libify a couple of functions
Move create_in_place_tempfile() and process_trailers() from builtin/interpret-trailers.c into trailer.c and expose it via trailer.h. This reverts most of ae0ec2e (trailer: move interpret_trailers() to interpret-trailers.c, 2024-03-01) and lets other call sites reuse the same trailer rewriting logic. Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for a4fd4c5 - Browse repository at this point
Copy the full SHA a4fd4c5View commit details -
trailer: append trailers without fork/exec
Introduce amend_strbuf_with_trailers() to apply trailer additions to a message buffer via process_trailers(), avoiding the need to run git interpret-trailers as a child process. Update amend_file_with_trailers() to use the in-process helper and rewrite the target file via tempfile+rename, preserving the previous in-place semantics. As the trailers are no longer added in a separate process and trailer_config_init() die()s on missing config values it is called early on in cmd_commit() and cmd_tag() so that they die() early before writing the message file. The trailer arguments are now also sanity checked. Keep existing callers unchanged by continuing to accept argv-style --trailer=<trailer> entries and stripping the prefix before feeding the in-process implementation. Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 6b2243f - Browse repository at this point
Copy the full SHA 6b2243fView commit details -
commit, tag: parse --trailer with OPT_STRVEC
Now that amend_file_with_trailers() expects raw trailer lines, do not store argv-style "--trailer=<trailer>" strings in git commit and git tag. Parse --trailer using OPT_STRVEC so trailer_args contains only the trailer value, and drop the temporary prefix stripping in amend_file_with_trailers(). Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 5e14869 - Browse repository at this point
Copy the full SHA 5e14869View commit details -
Add a new --trailer=<trailer> option to git rebase to append trailer lines to each rewritten commit message (merge backend only). Because the apply backend does not provide a commit-message filter, reject --trailer when --apply is in effect and require the merge backend instead. This option implies --force-rebase so that fast-forwarded commits are also rewritten. Validate trailer arguments early to avoid starting an interactive rebase with invalid input. Add integration tests covering error paths and trailer insertion across non-interactive and interactive rebases. Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for e4f9d6b - Browse repository at this point
Copy the full SHA e4f9d6bView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff a7a079c2c4bc7b269229a6ea6c147b6b2d5b2684...e4f9d6b0ab2e1903765258991a6265599d0007ce