Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
092bd15
send-email: fix bug resulting in broken threads if a message is edited
AdityaGarg8 Jun 4, 2025
2cc27b3
send-email: show the new message id assigned by outlook in the logs
AdityaGarg8 Jun 4, 2025
7cd080a
contrib/subtree: parse using --stuck-long
pweiskircher Jun 4, 2025
fea50ce
contrib/subtree: add -S/--gpg-sign
pweiskircher Jun 4, 2025
e6659b7
stash: allow "git stash -p <pathspec>" to assume push again
phillipwood Jun 7, 2025
468817b
stash: allow "git stash [<options>] --patch <pathspec>" to assume push
phillipwood Jun 7, 2025
a3d278b
revision: fix memory leak in prepare_show_merge()
brandb97 Jun 10, 2025
b1d47b4
environment: remove the global variable 'core_preload_index'
ayu-ch Jun 10, 2025
1fde1c5
preload-index: stop depending on 'the_repository'
ayu-ch Jun 10, 2025
ffb36c6
stash: fix incorrect branch name in stash message
jayatheerthkulkarni Jun 11, 2025
fdbea08
CodingGuidelines: let BSS do its job
gitster Jun 11, 2025
abf94a2
cat-file: fix mailmap application for different author and committer
edith007 Jun 13, 2025
2939494
git.c: remove the_repository dependence in run_builtin()
brandb97 Jun 16, 2025
855cfc6
t2400: replace 'test -[efd]' with 'test_path_is_*'
rodrigocmichelassi Jun 17, 2025
afe1a7a
Merge branch 'pw/subtree-gpg-sign'
gitster Jun 24, 2025
d2fb103
Merge branch 'pw/stash-p-pathspec-fixes'
gitster Jun 24, 2025
91e15c5
Merge branch 'ag/send-email-edit-threading-fix'
gitster Jun 24, 2025
77eb1dc
Merge branch 'kj/stash-onbranch-submodule-fix'
gitster Jun 24, 2025
f6e507f
Merge branch 'ly/prepare-show-merge-leakfix'
gitster Jun 24, 2025
2859812
Merge branch 'ac/preload-index-wo-the-repository'
gitster Jun 24, 2025
1f08250
Merge branch 'jc/cg-let-bss-do-its-job'
gitster Jun 24, 2025
1e60e1d
Merge branch 'sa/multi-mailmap-fix'
gitster Jun 24, 2025
da59201
Merge branch 'rm/t2400-modernize'
gitster Jun 24, 2025
277c3e8
Merge branch 'ly/run-builtin-use-passed-in-repo'
gitster Jun 24, 2025
f0135a9
The third batch
gitster Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ For C programs:
encouraged to have a blank line between the end of the declarations
and the first statement in the block.

- Do not explicitly initialize global variables to 0 or NULL;
instead, let BSS take care of the zero initialization.

- NULL pointers shall be written as NULL, not as 0.

- When declaring pointers, the star sides with the variable
Expand Down
26 changes: 26 additions & 0 deletions Documentation/RelNotes/2.51.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ UI, Workflows & Features
pathspec at the end of the command line, just like normal "git
diff".

* "git subtree" (in contrib/) learned to grok GPG signing its commits.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand All @@ -32,6 +34,9 @@ Performance, Internal Implementation, Development Support etc.
* Meson-based build/test framework now understands TAP output
generated by our tests.

* "Do not explicitly initialize to zero" rule has been clarified in
the CodingGuidelines document.


Fixes since v2.50
-----------------
Expand All @@ -47,6 +52,23 @@ Fixes since v2.50
corrected.
(merge 3717a5775a jw/doc-txt-to-adoc-refs later to maint).

* "git stash -p <pathspec>" improvements.
(merge 468817bab2 pw/stash-p-pathspec-fixes later to maint).

* "git send-email" incremented its internal message counter when a
message was edited, which made logic that treats the first message
specially misbehave, which has been corrected.
(merge 2cc27b3501 ag/send-email-edit-threading-fix later to maint).

* "git stash" recorded a wrong branch name when submodules are
present in the current checkout, which has been corrected.
(merge ffb36c64f2 kj/stash-onbranch-submodule-fix later to maint).

* When asking to apply mailmap to both author and committer field
while showing a commit object, the field that appears later was not
correctly parsed and replaced, which has been corrected.
(merge abf94a283f sa/multi-mailmap-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge b257adb571 lo/my-first-ow-doc-update later to maint).
(merge 8b34b6a220 ly/sequencer-update-squash-is-fixup-only later to maint).
Expand All @@ -56,3 +78,7 @@ Fixes since v2.50
(merge bfc9f9cc64 ly/submodule-update-failure-leakfix later to maint).
(merge 65dff89c6b ma/doc-diff-cc-headers later to maint).
(merge efb61591ee jm/bundle-uri-debug-output-to-fp later to maint).
(merge a3d278bb64 ly/prepare-show-merge-leakfix later to maint).
(merge 1fde1c5daf ac/preload-index-wo-the-repository later to maint).
(merge 855cfc65ae rm/t2400-modernize later to maint).
(merge 2939494284 ly/run-builtin-use-passed-in-repo later to maint).
20 changes: 15 additions & 5 deletions builtin/stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,7 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b
const char *head_short_sha1 = NULL;
const char *branch_ref = NULL;
const char *branch_name = "(no branch)";
char *branch_name_buf = NULL;
struct commit *head_commit = NULL;
struct commit_list *parents = NULL;
struct strbuf msg = STRBUF_INIT;
Expand Down Expand Up @@ -1404,8 +1405,12 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b

branch_ref = refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
"HEAD", 0, NULL, &flags);
if (flags & REF_ISSYMREF)
skip_prefix(branch_ref, "refs/heads/", &branch_name);

if (flags & REF_ISSYMREF) {
if (skip_prefix(branch_ref, "refs/heads/", &branch_name))
branch_name = branch_name_buf = xstrdup(branch_name);
}

head_short_sha1 = repo_find_unique_abbrev(the_repository,
&head_commit->object.oid,
DEFAULT_ABBREV);
Expand Down Expand Up @@ -1495,6 +1500,7 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b
strbuf_release(&msg);
strbuf_release(&untracked_files);
free_commit_list(parents);
free(branch_name_buf);
return ret;
}

Expand Down Expand Up @@ -1789,11 +1795,15 @@ static int push_stash(int argc, const char **argv, const char *prefix,
int ret;

if (argc) {
force_assume = !strcmp(argv[0], "-p");
int flags = PARSE_OPT_KEEP_DASHDASH;

if (push_assumed)
flags |= PARSE_OPT_STOP_AT_NON_OPTION;

argc = parse_options(argc, argv, prefix, options,
push_assumed ? git_stash_usage :
git_stash_push_usage,
PARSE_OPT_KEEP_DASHDASH);
git_stash_push_usage, flags);
force_assume |= patch_mode;
}

if (argc) {
Expand Down
5 changes: 0 additions & 5 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,11 +1595,6 @@ static int git_default_core_config(const char *var, const char *value,
return 0;
}

if (!strcmp(var, "core.preloadindex")) {
core_preload_index = git_config_bool(var, value);
return 0;
}

if (!strcmp(var, "core.createobject")) {
if (!value)
return config_error_nonbool(var);
Expand Down
19 changes: 13 additions & 6 deletions contrib/subtree/git-subtree.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ git-subtree - Merge subtrees together and split repository into subtrees
SYNOPSIS
--------
[verse]
'git subtree' [<options>] -P <prefix> add <local-commit>
'git subtree' [<options>] -P <prefix> add <repository> <remote-ref>
'git subtree' [<options>] -P <prefix> merge <local-commit> [<repository>]
'git subtree' [<options>] -P <prefix> split [<local-commit>]
'git subtree' [<options>] -P <prefix> [-S[<keyid>]] add <local-commit>
'git subtree' [<options>] -P <prefix> [-S[<keyid>]] add <repository> <remote-ref>
'git subtree' [<options>] -P <prefix> [-S[<keyid>]] merge <local-commit> [<repository>]
'git subtree' [<options>] -P <prefix> [-S[<keyid>]] split [<local-commit>]

[verse]
'git subtree' [<options>] -P <prefix> pull <repository> <remote-ref>
'git subtree' [<options>] -P <prefix> push <repository> <refspec>
'git subtree' [<options>] -P <prefix> [-S[<keyid>]] pull <repository> <remote-ref>
'git subtree' [<options>] -P <prefix> [-S[<keyid>]] push <repository> <refspec>

DESCRIPTION
-----------
Expand Down Expand Up @@ -149,6 +149,13 @@ OPTIONS FOR ALL COMMANDS
want to manipulate. This option is mandatory
for all commands.

-S[<keyid>]::
--gpg-sign[=<keyid>]::
--no-gpg-sign::
GPG-sign commits. The `keyid` argument is optional and
defaults to the committer identity; `--no-gpg-sign` is useful to
countermand a `--gpg-sign` option given earlier on the command line.

OPTIONS FOR 'add' AND 'merge' (ALSO: 'pull', 'split --rejoin', AND 'push --rejoin')
-----------------------------------------------------------------------------------
These options for 'add' and 'merge' may also be given to 'pull' (which
Expand Down
66 changes: 32 additions & 34 deletions contrib/subtree/git-subtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ then
fi

OPTS_SPEC="\
git subtree add --prefix=<prefix> <commit>
git subtree add --prefix=<prefix> <repository> <ref>
git subtree merge --prefix=<prefix> <commit>
git subtree split --prefix=<prefix> [<commit>]
git subtree pull --prefix=<prefix> <repository> <ref>
git subtree push --prefix=<prefix> <repository> <refspec>
git subtree add --prefix=<prefix> [-S[=<key-id>]] <commit>
git subtree add --prefix=<prefix> [-S[=<key-id>]] <repository> <ref>
git subtree merge --prefix=<prefix> [-S[=<key-id>]] <commit>
git subtree split --prefix=<prefix> [-S[=<key-id>]] [<commit>]
git subtree pull --prefix=<prefix> [-S[=<key-id>]] <repository> <ref>
git subtree push --prefix=<prefix> [-S[=<key-id>]] <repository> <refspec>
--
h,help! show the help
q,quiet! quiet
Expand All @@ -46,6 +46,7 @@ rejoin merge the new branch back into HEAD
options for 'add' and 'merge' (also: 'pull', 'split --rejoin', and 'push --rejoin')
squash merge subtree changes as a single commit
m,message!= use the given message as the commit message for the merge commit
S,gpg-sign?key-id GPG-sign commits. The keyid argument is optional and defaults to the committer identity
"

indent=0
Expand Down Expand Up @@ -115,7 +116,7 @@ main () {
then
set -- -h
fi
set_args="$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"
set_args="$(echo "$OPTS_SPEC" | git rev-parse --parseopt --stuck-long -- "$@" || echo exit $?)"
eval "$set_args"
. git-sh-setup
require_work_tree
Expand All @@ -131,9 +132,6 @@ main () {
opt="$1"
shift
case "$opt" in
--annotate|-b|-P|-m|--onto)
shift
;;
--rejoin)
arg_split_rejoin=1
;;
Expand Down Expand Up @@ -171,48 +169,44 @@ main () {
arg_split_annotate=
arg_addmerge_squash=
arg_addmerge_message=
arg_gpg_sign=
while test $# -gt 0
do
opt="$1"
shift

case "$opt" in
-q)
--quiet)
arg_quiet=1
;;
-d)
--debug)
arg_debug=1
;;
--annotate)
--annotate=*)
test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_annotate="$1"
shift
arg_split_annotate="${opt#*=}"
;;
--no-annotate)
test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_annotate=
;;
-b)
--branch=*)
test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_branch="$1"
shift
arg_split_branch="${opt#*=}"
;;
-P)
arg_prefix="${1%/}"
shift
--prefix=*)
arg_prefix="${opt#*=}"
;;
-m)
--message=*)
test -n "$allow_addmerge" || die_incompatible_opt "$opt" "$arg_command"
arg_addmerge_message="$1"
shift
arg_addmerge_message="${opt#*=}"
;;
--no-prefix)
arg_prefix=
;;
--onto)
--onto=*)
test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
arg_split_onto="$1"
shift
arg_split_onto="${opt#*=}"
;;
--no-onto)
test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"
Expand Down Expand Up @@ -240,6 +234,9 @@ main () {
test -n "$allow_addmerge" || die_incompatible_opt "$opt" "$arg_command"
arg_addmerge_squash=
;;
--gpg-sign=* | --gpg-sign | --no-gpg-sign)
arg_gpg_sign="$opt"
;;
--)
break
;;
Expand Down Expand Up @@ -272,6 +269,7 @@ main () {
debug "quiet: {$arg_quiet}"
debug "dir: {$dir}"
debug "opts: {$*}"
debug "gpg-sign: {$arg_gpg_sign}"
debug

"cmd_$arg_command" "$@"
Expand Down Expand Up @@ -537,7 +535,7 @@ copy_commit () {
printf "%s" "$arg_split_annotate"
cat
) |
git commit-tree "$2" $3 # reads the rest of stdin
git commit-tree $arg_gpg_sign "$2" $3 # reads the rest of stdin
) || die "fatal: can't copy commit $1"
}

Expand Down Expand Up @@ -683,10 +681,10 @@ new_squash_commit () {
if test -n "$old"
then
squash_msg "$dir" "$oldsub" "$newsub" |
git commit-tree "$tree" -p "$old" || exit $?
git commit-tree $arg_gpg_sign "$tree" -p "$old" || exit $?
else
squash_msg "$dir" "" "$newsub" |
git commit-tree "$tree" || exit $?
git commit-tree $arg_gpg_sign "$tree" || exit $?
fi
}

Expand Down Expand Up @@ -925,11 +923,11 @@ cmd_add_commit () {
then
rev=$(new_squash_commit "" "" "$rev") || exit $?
commit=$(add_squashed_msg "$rev" "$dir" |
git commit-tree "$tree" $headp -p "$rev") || exit $?
git commit-tree $arg_gpg_sign "$tree" $headp -p "$rev") || exit $?
else
revp=$(peel_committish "$rev") || exit $?
commit=$(add_msg "$dir" $headrev "$rev" |
git commit-tree "$tree" $headp -p "$revp") || exit $?
git commit-tree $arg_gpg_sign "$tree" $headp -p "$revp") || exit $?
fi
git reset "$commit" || exit $?

Expand Down Expand Up @@ -1080,9 +1078,9 @@ cmd_merge () {
if test -n "$arg_addmerge_message"
then
git merge --no-ff -Xsubtree="$arg_prefix" \
--message="$arg_addmerge_message" "$rev"
--message="$arg_addmerge_message" $arg_gpg_sign "$rev"
else
git merge --no-ff -Xsubtree="$arg_prefix" $rev
git merge --no-ff -Xsubtree="$arg_prefix" $arg_gpg_sign $rev
fi
}

Expand Down
Loading