Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a8faa7a
http: extract http_reauth_prepare() from retry paths
mjcheetham Apr 16, 2026
5dbc8c1
http: attempt Negotiate auth in http.emptyAuth=auto mode
mjcheetham Apr 16, 2026
9b1630b
t5563: add tests for http.emptyAuth with Negotiate
mjcheetham Apr 16, 2026
890229b
t6112: avoid tilde expansion
szeder Apr 21, 2026
b7b8449
xdiff/xdl_cleanup_records: delete local recs pointer
ezekielnewren Apr 29, 2026
c37f8cd
xdiff: use unambiguous types in xdl_bogo_sqrt()
ezekielnewren Apr 29, 2026
2168025
xdiff/xdl_cleanup_records: use unambiguous types
ezekielnewren Apr 29, 2026
f99a023
xdiff/xdl_cleanup_records: make limits more clear
ezekielnewren Apr 29, 2026
c355f69
xdiff/xdl_cleanup_records: make setting action easier to follow
ezekielnewren Apr 29, 2026
f87808b
xdiff/xdl_cleanup_records: make execution of action easier to follow
ezekielnewren Apr 29, 2026
4919938
doc: clarify http.emptyAuth values
mjcheetham Apr 30, 2026
ab9753e
doc: restore: remove double underscore
LemmingAvalanche May 5, 2026
48c855b
doc: add caveat about turning off commit-graph
LemmingAvalanche May 7, 2026
aa45a59
submodule-config: fix reading submodule.fetchJobs
saagarjha May 10, 2026
31e8fca
sideband: clear full line when printing remote messages
rscharfe May 10, 2026
106b688
rebase: ignore non-branch update-refs
abhinav May 10, 2026
7c78d24
name-rev: wrap both blocks in braces
LemmingAvalanche May 11, 2026
b9c1be4
name-rev: run clang-format before factoring code
LemmingAvalanche May 11, 2026
e291632
name-rev: factor code for sharing with a new command
LemmingAvalanche May 11, 2026
ae34adc
name-rev: make dedicated --annotate-stdin --name-only test
LemmingAvalanche May 11, 2026
19e3106
format-rev: introduce builtin for on-demand pretty formatting
LemmingAvalanche May 11, 2026
60afbae
Merge branch 'mc/http-emptyauth-negotiate-fix'
gitster May 19, 2026
0330568
Merge branch 'en/xdiff-cleanup-3'
gitster May 19, 2026
6bfdc87
Merge branch 'sg/t6112-unwanted-tilde-expansion-fix'
gitster May 19, 2026
056472b
Merge branch 'kh/name-rev-custom-format'
gitster May 19, 2026
55c4fea
Merge branch 'kh/doc-commit-graph'
gitster May 19, 2026
c297fdf
Merge branch 'kh/doc-restore-double-underscores-fix'
gitster May 19, 2026
1cde0a6
Merge branch 'ag/rebase-update-refs-limit-to-branches'
gitster May 19, 2026
ded7b8c
Merge branch 'rs/sideband-clear-line-before-print'
gitster May 19, 2026
bad1648
Merge branch 'sj/submodule-update-clone-config-fix'
gitster May 19, 2026
7bcaabd
The 4th batch
gitster May 18, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
/git-for-each-ref
/git-for-each-repo
/git-format-patch
/git-format-rev
/git-fsck
/git-fsck-objects
/git-fsmonitor--daemon
Expand Down
32 changes: 32 additions & 0 deletions Documentation/RelNotes/2.55.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ UI, Workflows & Features
branch, but it gave only one chance to resolve conflicts. The command
was taught to create a stash to save the local changes.

* A new builtin "git format-rev" is introduced for pretty formatting
one revision expression per line or commit object names found in
running text.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand All @@ -31,6 +35,8 @@ Performance, Internal Implementation, Development Support etc.
* Rust support is enabled by default (but still allows opting out) in
some future version of Git.
* Preparation of the xdiff/ codebase to work with Rust.
Fixes since v2.54
-----------------
Expand Down Expand Up @@ -76,10 +82,36 @@ Fixes since v2.54
disabling C11 language features, causing build failures..
(merge 0a6d29090c ps/clang-w-glibc-2.43-and-_Generic later to maint).

* The 'http.emptyAuth=auto' configuration now correctly attempts
Negotiate authentication before falling back to manual credentials.
This allows seamless Kerberos ticket-based authentication without
requiring users to explicitly set 'http.emptyAuth=true'.
(merge 4919938d28 mc/http-emptyauth-negotiate-fix later to maint).

* Ramifications of turning off commit-graph has been documented a bit
more clearly.
(merge 48c855bb8f kh/doc-commit-graph later to maint).

* "git rebase --update-refs", when used with an rebase.instructionFormat
with "%d" (describe) in it, tried to update local branch HEAD by
mistake, which has been corrected.
(merge 106b6885c7 ag/rebase-update-refs-limit-to-branches later to maint).

* Tweak the way how sideband messages from remote are printed while
we talk with a remote repository to avoid tickling terminal
emulator glitches.
(merge 31e8fcabd8 rs/sideband-clear-line-before-print later to maint).

* The configuration variable submodule.fetchJobs was not read correctly,
which has been corrected.
(merge aa45a5902f sj/submodule-update-clone-config-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 80f4b802e9 ja/doc-difftool-synopsis-style later to maint).
(merge b96490241e jc/doc-timestamps-in-stat later to maint).
(merge 66ae1a48ec jc/t5551-fix-expensive later to maint).
(merge ef85286e51 ss/t7004-unhide-git-failures later to maint).
(merge 7584d10bc2 mf/format-patch-cover-letter-format-docfix later to maint).
(merge 8547908eb3 pw/rename-to-get-current-worktree later to maint).
(merge 890229b3f3 sg/t6112-unwanted-tilde-expansion-fix later to maint).
(merge ab9753e7bc kh/doc-restore-double-underscores-fix later to maint).
13 changes: 12 additions & 1 deletion Documentation/config/http.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,18 @@ http.emptyAuth::
Attempt authentication without seeking a username or password. This
can be used to attempt GSS-Negotiate authentication without specifying
a username in the URL, as libcurl normally requires a username for
authentication.
authentication. Possible values are:
+
--
* `auto` (default) - Send empty credentials only if the server's 401 response
advertises an authentication mechanism that requires them (such as
GSS-Negotiate); otherwise fall back to prompting via the credential helper.
* `true` - Always send empty credentials on the very first request, before
receiving any 401 response from the server.
* `false` - Never send empty credentials. Mechanisms that require
empty credentials or an explicit username, such as GSS-Negotiate, will not
work.
--

http.proactiveAuth::
Attempt authentication without first making an unauthenticated attempt and
Expand Down
6 changes: 6 additions & 0 deletions Documentation/git-commit-graph.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ $ git show-ref -s | git commit-graph write --stdin-commits
$ git rev-parse HEAD | git commit-graph write --stdin-commits --append
------------------------------------------------

CAVEATS
-------

The existence of replace objects or commit grafts turns off reading or
writing to the commit-graph. See linkgit:git-replace[1].

CONFIGURATION
-------------

Expand Down
215 changes: 215 additions & 0 deletions Documentation/git-format-rev.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
git-format-rev(1)
=================

NAME
----
git-format-rev - EXPERIMENTAL: Pretty format revisions on demand


SYNOPSIS
--------
[synopsis]
(EXPERIMENTAL!) git format-rev --stdin-mode=<mode> --format=<pretty> [--[no-]notes=<ref>] [-z] [--[no-]null-output] [--[no-]null-input]

DESCRIPTION
-----------

Pretty format revisions from standard input.

THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

OPTIONS
-------

`--stdin-mode=<mode>`::
How to interpret standard input data:
+
--
`revs`;; Each line or record (see the <<io,INPUT AND OUTPUT FORMATS>>
section) is interpreted as a commit. Any kind of revision
expression can be used (see linkgit:gitrevisions[7]). Annotated
tags are peeled (see linkgit:gitglossary[7]).
+
The argument `rev` is also accepted.

`text`;; Formats all commit object names found in freeform text. These
must the full object names, i.e. abbreviated hexidecimal object
names will not be interpreted.
+
Anything that is parsed as an object name but that is not found to be a
commit object name is left alone (echoed).
--

`--format=<pretty>`::
Pretty format string.

`--notes=<ref>`::
`--no-notes`::
Custom notes ref. Notes are displayed when using the `%N`
atom. See linkgit:git-notes[1].

`-z`::
`--null`::
Use _NUL_ character to terminate both input and output instead
of newline. This option cannot be negated.
+
This is useful if both the input and output could contain newlines or if
the input to this command also uses _NUL_ character termination; see the
<<io,INPUT AND OUTPUT FORMATS>> section below.
+
The mode `--stdin-mode=text` can have use for this option when it needs
to process input like for example `git last-modified -z`; see the
<<examples,EXAMPLES>> section below.

`--null-output`::
`--no-null-output`::
Use _NUL_ character to terminate output instead of newline. The
default is `--no-null-output`.
+
This is useful if the output could contain newlines, for example if the
`%n` (newline) atom is used.

`--null-input`::
`--no-null-input`::
Use _NUL_ character to terminate input instead of newline. The
default is `--no-null-input`.
+
This is useful if the input revision expressions could contain newlines.

[[io]]
INPUT AND OUTPUT FORMAT
-----------------------

The command uses newlines for both input and output termination by
default. See the `-z`, `--null-output`, and `--null-input` options for
using _NUL_ character as the terminator.

The mode `--stdin-mode=revs` outputs one formatted commit followed by
the terminator. This could either be called a _line_ or a _record_ in
case "line" is too suggestive of newline termination.

Note that this means that the terminator character (newline or _NUL_)
acts as a _terminator_, not a _separator_. In other words, the final
line or record is also terminated by the terminator character.

The mode `--stdin-mode=text` replaces each object name with the
formatted commit, i.e. the format `%s` would transform some commit
object name to `<subject>` without any termination. Like this:

----
Did we not fix this in "<subject>"?
----

It is safe to interactively read and write from this command since each
record is immediately flushed.

[[examples]]
EXAMPLES
--------

The command linkgit:git-last-modified[1] shows the commit that each file
was last modified in.

----
$ git last-modified -- README.md Makefile
7798034171030be0909c56377a4e0e10e6d2df93 Makefile
c50fbb2dd225e7e82abba4380423ae105089f4d7 README.md
----

We can pipe the result to this command in order to replace the object
name with the commit author.

----
$ git last-modified -- README.md Makefile |
git format-rev --stdin-mode=text --format=%an
Junio C Hamano Makefile
Todd Zullinger README.md
----

Another example is _formatting commits in commit messages_. Given this commit message:

----
Fix off-by-one error

Fix off-by-one error introduced in
e83c5163316f89bfbde7d9ab23ca2e25604af290.

We thought we fixed this in 5569bf9bbedd63a00780fc5c110e0cfab3aa97b9 but
that only covered 1/3 of the faulty cases.
----

We can format the commits and use par(1) to reflow the text, say in a
`commit-msg` hook:

----
$ git config set hook.reference-commits.event commit-msg
$ git config set hook.reference-commits.command reference-commits
$ cat $(which reference-commits)
#/bin/sh

msg="$1"
rewritten=$(mktemp)
git format-rev --stdin-mode=text --format=reference <"$msg" |
par >"$rewritten"
mv "$rewritten" "$msg"
----

Which will produce something like this:

----
Fix off-by-one error

Fix off-by-one error introduced in e83c5163316 (Implement better memory
allocator, 2005-04-07).

We thought we fixed this in 5569bf9bbed (Fix memory allocator,
2005-06-22) but that only covered 1/3 of the faulty cases.
----

DISCUSSION
----------

This command lets you format any number of revisions in any order
through one command invocation. Consider the
linkgit:git-last-modified[1] case from the <<examples,EXAMPLES>> section
above:

1. There might be hundreds of files
2. Commits can be repeated, i.e. two or more files were last modified in
the same commit

Two widely-used commands which pretty formats commits are
linkgit:git-log[1] and linkgit:git-show[1]. It turns out that they are
not a good fit for the above use case.

- The output of linkgit:git-last-modified[1] would have to be processed
in stages since you need to transform the first column separately and
then link the author to the filename. But this is surmountable.
- You can feed each commit to `git show` or `git log --no-walk -1`. But
that means that you need to create a process for each line.
- Let’s say that you want to use one process, not one per line. So you
want to feed all the commits to the command. Now you face the problem
that you have to feed all the commits to the commands before you get
any output (this is also the case for the `--stdin` modes). In other
words, you cannot loop through each line, get the author for the
commit, and output the author and the filename. You need to feed all
the commits, get back all the output, and match the output with the
filename.
- But the next problem is that commands will deduplicate the input and
only output one commit one single time only. Thus you cannot make the
output order match the input order, since a commit could have been
repeated in the original input.

In short, it is straightforward to use these two commands if you use one
process per line. It is much more work if you just want to use one
process, but still doable. In contrast, this problem is solved with just
another shell pipeline with this command.

SEE ALSO
--------
linkgit:git-name-rev[1],
linkgit:git-log[1].

GIT
---
Part of the linkgit:git[1] suite
7 changes: 7 additions & 0 deletions Documentation/git-replace.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ commit instead of the replaced commit.
There may be other problems when using 'git rev-list' related to
pending objects.

CAVEATS
-------

The existence of replace objects or commit grafts turns off reading or
writing to the commit-graph, which can cause performance issues. See
linkgit:git-commit-graph[1].

SEE ALSO
--------
linkgit:git-hash-object[1]
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-restore.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ given, otherwise from the index.
+
As a special case, you may use `"<rev-A>...<rev-B>"` as a shortcut for the
merge base of _<rev-A>_ and _<rev-B>_ if there is exactly one merge base. You can
leave out at most one of _<rev-A>__ and _<rev-B>_, in which case it defaults to `HEAD`.
leave out at most one of _<rev-A>_ and _<rev-B>_, in which case it defaults to `HEAD`.

`-p`::
`--patch`::
Expand Down
1 change: 1 addition & 0 deletions Documentation/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ manpages = {
'git-for-each-ref.adoc' : 1,
'git-for-each-repo.adoc' : 1,
'git-format-patch.adoc' : 1,
'git-format-rev.adoc' : 1,
'git-fsck-objects.adoc' : 1,
'git-fsck.adoc' : 1,
'git-fsmonitor--daemon.adoc' : 1,
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ BUILT_INS += $(patsubst builtin/%.o,git-%$X,$(BUILTIN_OBJS))
BUILT_INS += git-cherry$X
BUILT_INS += git-cherry-pick$X
BUILT_INS += git-format-patch$X
BUILT_INS += git-format-rev$X
BUILT_INS += git-fsck-objects$X
BUILT_INS += git-init$X
BUILT_INS += git-maintenance$X
Expand Down
1 change: 1 addition & 0 deletions builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix, struct re
int cmd_for_each_ref(int argc, const char **argv, const char *prefix, struct repository *repo);
int cmd_for_each_repo(int argc, const char **argv, const char *prefix, struct repository *repo);
int cmd_format_patch(int argc, const char **argv, const char *prefix, struct repository *repo);
int cmd_format_rev(int argc, const char **argv, const char *prefix, struct repository *repo);
int cmd_fsck(int argc, const char **argv, const char *prefix, struct repository *repo);
int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix, struct repository *repo);
int cmd_gc(int argc, const char **argv, const char *prefix, struct repository *repo);
Expand Down
Loading