Skip to content

fast forwarding #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from
Open

fast forwarding #1

wants to merge 10,000 commits into from

Conversation

hdu-hh
Copy link
Owner

@hdu-hh hdu-hh commented Nov 20, 2019

No description provided.

gitster and others added 30 commits May 9, 2025 13:14
* 'master' of https://github.com/j6t/git-gui:
  git-gui: treat the message template file as a built file
  git-gui: heed core.commentChar/commentString
  git-gui: po/README: update repository location and maintainer
* 'master' of https://github.com/j6t/gitk:
  gitk: add Tamil translation
  gitk: limit PATH search to bare executable names
  gitk: _search_exe is no longer needed
  gitk: override $PATH search only on Windows
  gitk: adjust indentation to match the style used in this script
In the next commit these functions will be called from pick_one_commit()
so move them above that function to avoid a forward declaration.

Signed-off-by: Phillip Wood <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
It has been reported that "git rebase --rebase-merges" can create
corrupted reflog entries like

    e9c962f2ea0 HEAD@{8}: <binary>�: Merged in <branch> (pull request #4441)

This is due to a use-after-free bug that happens because
reflog_message() uses a static `struct strbuf` and is not called to
update the current reflog message stored in `ctx->reflog_message` when
creating the merge. This means `ctx->reflog_message` points to a stale
reflog message that has been freed by subsequent call to
reflog_message() by a command such as `reset` that used the return value
directly rather than storing the result in `ctx->reflog_message`.

Fix this by creating the reflog message nearer to where the commit is
created and storing it in a local variable which is passed as an
additional parameter to run_git_commit() rather than storing the message
in `struct replay_ctx`. This makes it harder to forget to call
`reflog_message()` before creating a commit and using a variable with a
narrower scope means that a stale value cannot carried across a from one
iteration of the loop to the next which should prevent any similar
use-after-free bugs in the future.

A existing test is modified to demonstrate that merges are now created
with the correct reflog message.

Reported-by: Kristoffer Haugsbakk <[email protected]>
Signed-off-by: Phillip Wood <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Many contributors to software use a Language Server Protocol
implementation to allow their editor to learn structural information
about the code they write and provide additional features, such as
jumping to the declaration or definition of a function or type.  In C,
the usual implementation is clangd, which requires compiling with clang.

Because C and C++ projects lack a standard file system layout and build
system, unlike languages such as Rust and Go, clangd requires a
compilation database to be generated by the clang compiler in order to
pass the proper compilation flags and discover all of the files
necessary to make the LSP work.  This is done by setting
GENERATE_COMPILATION_DATABASE to "yes".

However, when that's enabled and the user runs "make" a second time,
all of the files are re-compiled, which is inconvenient for contributors
to Git, since it makes small changes or rebases recompile the entirety
of the codebase.  This happens because the directory holding the
compilation database is updated anytime an object is built, so its
modification date will always be newer than the first object built.

To solve this, use the same trick we do just above for the .depend
directory and filter the compilation database directory out if it
already exists, which avoids making it a target to be built.

Signed-off-by: brian m. carlson <[email protected]>
Helped-by: Philippe Blain <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Use "proc makedroplist" function to support combobox on legacy widgets
mode. "proc makedroplist" uses "ttk::combobox" for themed mode, and uses
"tk_optionMenu" for legacy mode to get rid of the problem.

Signed-off-by: YOKOTA Hiroshi <[email protected]>
Signed-off-by: Johannes Sixt <[email protected]>
In reftable/writer.c:padded_write(), if w->writer failed, zeroed
allocated in `reftable_calloc` will leak. w->writer could be
`reftable_write_data` in reftable/stack.c, and could fail due to
some write error. Simply add reftable_free(zeroed) will solve this
problem.

Signed-off-by: Lidong Yan <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
In reftable/writer.c:writer_index_hash(), if `reftable_buf_add` failed,
key allocated by `reftable_malloc` will not be insert into `obj_index_tree`
thus leaks. Simple add reftable_free(key) will solve this problem.

Signed-off-by: Lidong Yan <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
To unify mark-up used in our documentation to a newer convention,
started by 2229389 (doc: apply synopsis simplification on git-clone
and git-init, 2024-09-24), update the documentation of 'git daemon'
to

 * use [synopsis], not [verse] in the SYNOPSIS section
 * enclose `--option=<value>` in backquotes

Also, split '--[no-]option' into '--option' and '--no-option'
to make it easier to grep for them.

Signed-off-by: Junio C Hamano <[email protected]>
Helped-by: Jean-Noël Avila <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
…ions

To unify mark-up used in our documentation to a newer convention,
started by 2229389 (doc: apply synopsis simplification on git-clone
and git-init, 2024-09-24), update the documentation for 'git var' and
'git write-tree' to

 * use [synopsis], not [verse] in the SYNOPSIS section
 * enclose `--option=<value>` in backquotes

Signed-off-by: Junio C Hamano <[email protected]>
Helped-by: Jean-Noël Avila <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
To unify mark-up used in our documentation to a newer convention,
started by 2229389 (doc: apply synopsis simplification on git-clone
and git-init, 2024-09-24), update the documentation pages for 'git
verify-commit', 'git verify-tag', and 'git verify-pack' to

 * use [synopsis], not [verse] in the SYNOPSIS section
 * enclose `--option=<value>` in backquotes
 * do not describe non-option arguments in the OPTIONS section

Signed-off-by: Junio C Hamano <[email protected]>
Helped-by: Jean-Noël Avila <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
When refering to environment variables in the documentation, use the
ENV_VARIABLE format instead of $ENV_VARIABLE. The latter is used in the
documentation to refer to the actual value of the variable, not the name
of the variable.

Signed-off-by: Jean-Noël Avila <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
'test_path_is_file' is a modern path checking method in Git's development.
 Replace the basic shell command 'test -f' with this approach.

Signed-off-by: Rodrigo Carvalho <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
In builtin/am.c:split_mail_stgit_series, if `fopen` failed,
`series_dir_buf` allocated by `xstrdup` will leak. Add `free` in
`!fp` if branch will prevent the leak.

Signed-off-by: Lidong Yan <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
In fd88831 (reftable/table: move reading block into block reader,
2025-04-07), we have refactored how reftable blocks are read so that
most of the logic is contained in the "block.c" subsystem itself. Most
importantly, the whole logic to read the data itself is now contained in
that subsystem.

This change caused a significant performance regression though when
reading blocks that aren't of the specific type one is searching for:

    Benchmark 1: update-ref: create 100k refs (revision = fd88831~)
      Time (mean ± σ):      2.171 s ±  0.028 s    [User: 1.189 s, System: 0.977 s]
      Range (min … max):    2.117 s …  2.206 s    10 runs

    Benchmark 2: update-ref: create 100k refs (revision = fd88831)
      Time (mean ± σ):      3.418 s ±  0.030 s    [User: 2.371 s, System: 1.037 s]
      Range (min … max):    3.377 s …  3.473 s    10 runs

    Summary
      update-ref: create 100k refs (revision = fd88831~) ran
        1.57 ± 0.02 times faster than update-ref: create 100k refs (revision = fd88831)

The root caute of the performance regression is that we changed when
exactly blocks of an uninteresting type are being discarded. Previous to
the refactoring in the mentioned commit we'd load the block data, read
its type, notice that it's not the wanted type and discard the block.
After the commit though we don't discard the block immediately, but we
fully decode it only to realize that it's not the desired type. We then
discard the block again, but have already performed a bunch of pointless
work.

Fix the regression by making `reftable_block_init()` return early in
case the block is not of the desired type. This fixes the performance
hit:

    Benchmark 1: update-ref: create 100k refs (revision = HEAD~)
      Time (mean ± σ):      2.712 s ±  0.018 s    [User: 1.990 s, System: 0.716 s]
      Range (min … max):    2.682 s …  2.741 s    10 runs

    Benchmark 2: update-ref: create 100k refs (revision = HEAD)
      Time (mean ± σ):      1.670 s ±  0.012 s    [User: 0.991 s, System: 0.676 s]
      Range (min … max):    1.652 s …  1.693 s    10 runs

    Summary
      update-ref: create 100k refs (revision = HEAD) ran
        1.62 ± 0.02 times faster than update-ref: create 100k refs (revision = HEAD~)

Note that the baseline performance is lower than in the original due to
a couple of unrelated performance improvements that have landed since
the original commit.

Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
In pack-bitmap.c:load_bitmap_entries_v1, the function `read_bitmap_1`
allocates a bitmap and reads index data into it. However, if any of
the validation checks following the allocation fail, the allocated bitmap
is not freed, resulting in a memory leak. To avoid this, the validation
checks should be performed before the bitmap is allocated.

Signed-off-by: Lidong Yan <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
This function does not free the oidmap struct itself; it just drops all
items from the map (using hashmap_clear_() internally). It should be
called oidmap_clear(), per CodingGuidelines.

Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Callers which want to know how many items are in an oidmap have to look
at the underlying hashmap struct, leaking an implementation detail.
Let's provide a type-appropriate wrapper and use it.

Note in the call from lookup_replace_object(), the caller was actually
looking at the hashmap's tablesize parameter (the allocated size of the
table) rather than hashmap_get_size(), the number of items in the table.
This probably should have been checking the number of items all along,
but the two are functionally equivalent here since we only add to the
map and never remove anything. Thus if there was any allocation, it was
because there is at least one item.

Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
We store the replacement data in an oidmap, which is itself a pointer in
the raw_object_store struct. But there's no need for an extra pointer
indirection here. It is always allocated and initialized along with the
containing struct, and we never check it for NULL-ness.

Let's embed the map directly in the struct, which is simpler and avoids
extra pointer chasing.

Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Update send-email to work better with Outlook's smtp server.

* ag/send-email-outlook:
  send-email: add --[no-]outlook-id-fix option
  send-email: retrieve Message-ID from outlook SMTP server
Further code clean-up in the object-store layer.

* ps/object-store-cleanup:
  object-store: drop `repo_has_object_file()`
  treewide: convert users of `repo_has_object_file()` to `has_object()`
  object-store: allow fetching objects via `has_object()`
  object-store: move function declarations to their respective subsystems
  object-store: move and rename `odb_pack_keep()`
  object-store: drop `loose_object_path()`
  object-store: move `struct packed_git` into "packfile.h"
Further refinement on CI messages when an optional external
software is unavailable (e.g. due to third-party service outage).

* jc/ci-skip-unavailable-external-software:
  ci: download JGit from maven, not eclipse.org
  ci: update the message for unavailble third-party software
"git index-pack --fix-thin" used to abort to prevent a cycle in
delta chains from forming in a corner case even when there is no
such cycle.

* ds/fix-thin-fix:
  index-pack: allow revisiting REF_DELTA chains
  t5309: create failing test for 'git index-pack'
  test-tool: add pack-deltas helper
"git diff --minimal" used to give non-minimal output when its
optimization kicked in, which has been disabled.

* ng/xdiff-truly-minimal:
  xdiff: disable cleanup_records heuristic with --minimal
Meson-based build framework update.

* ps/meson-bin-sh:
  meson: prefer shell at "/bin/sh"
  meson: report detected runtime executable paths
Signed-off-by: Junio C Hamano <[email protected]>
The GIT-GUI-VARS file is used to track whether any of our build options
has changed. Unfortunately, the format of that file does not allow us to
propagate those build options to other scripts. But as we are about to
introduce support for the Meson build system, we will extract a couple
of scripts to deduplicate core build logic across Makefiles and Meson.
With this refactoring, it will become necessary to make build options
more widely accessible.

Replace GIT-GUI-VARS with a new GIT-GUI-BUILD-OPTIONS file that is being
populated from a template. This file can easily be sourced from build
scripts in subsequent steps.

Signed-off-by: Patrick Steinhardt <[email protected]>
The GIT-VERSION-GEN unconditionally writes version information into the
source directory in the form of the "GIT-VERSION-FILE". We are about to
introduce the Meson build system though, which enforces out-of-tree
builds by default, and in that context we cannot continue to write
version information into the source tree.

Prepare the script for out-of-tree builds by treating the source
directory different from the output file.

Signed-off-by: Patrick Steinhardt <[email protected]>
The output of GIT-VERSION-GEN can be sourced by our Makefile to make the
version available there. The output has a couple of spaces around the
equals sign, which is perfectly valid for parsing it in our Makefile.
But in subsequent steps we'll also want to source the file in a couple
of newly-introduced shell scripts, but having spaces around variable
assignments is invalid there.

Prepare for this step by dropping the spaces surrounding the equals
sign. Like this, we can easily use the same file both in our Makefile
and in shell scripts.

Signed-off-by: Patrick Steinhardt <[email protected]>
The value of the GITGUI_SCRIPT variable is only used in a single place
as part of an sed(1) script that massages the "git-gui.sh" script.
Interestingly, this specific replacement does seem to be a no-op: we
replace "^ argv0=$$0" with " argv=$(GITGUI_SCRIPT)", which has a value
of "$$0". The result would thus be completely unchanged.

Drop the replacement and its variable.

Signed-off-by: Patrick Steinhardt <[email protected]>
gitster and others added 30 commits June 7, 2025 10:46
Adjust to newer version of libcURL.

* jk/curl-easy-setopt-typefix:
  curl: fix symbolic constant typechecks with curl_easy_setopt()
  curl: fix integer variable typechecks with curl_easy_setopt()
  curl: fix integer constant typechecks with curl_easy_setopt()
Adjust to newer version of libcURL.

* js/curl-easy-setopt-typefix:
  curl: pass `long` values where expected
Signed-off-by: Junio C Hamano <[email protected]>
Tests that compare $HOME and $(pwd), which should be the same
directory unless the tests chdir's around, would fail when the user
enters the test directory via symbolic links, which has been
corrected.

* mm/test-in-absolute-home:
  t: run tests from a normalized working directory
Signed-off-by: Junio C Hamano <[email protected]>
Signed-off-by: Kristoffer Haugsbakk <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
* 'master' of github.com:aindriu80/git-po:
  l10n: Add full Irish translation (ga.po)
* 'tr-l10n' of github.com:bitigchi/git-po:
  l10n: tr: Update Turkish translations for 2.50
* 'l10n_fr_v2.50' of github.com:jnavila/git:
  l10n: fr: v2.50 round 1
* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5819t)
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.50
Co-authored-by: Kate Golovanova <[email protected]>
Co-authored-by: Tamara Lazerka <[email protected]>
Signed-off-by: Arkadii Yakovets <[email protected]>
Signed-off-by: Kate Golovanova <[email protected]>
Signed-off-by: Tamara Lazerka <[email protected]>
When I added the Coverity workflow in a56b623 (ci: add a GitHub
workflow to submit Coverity scans, 2023-09-25), I merely converted an
Azure Pipeline definition that had been running successfully for ages.

In the meantime, the current Coverity documentation describes a very
different way to install the analysis tool, recommending to add the
`bin/` directory to the _end_ of `PATH` (when originally, IIRC, it was
recommended to add it to the _beginning_ of the `PATH`).

This is crucial! The reason is that the current incarnation of the
Windows variant of Coverity's analysis tools come with a _lot_ of DLL
files in their `bin/` directory, some of them interferring rather badly
with the `gcc.exe` in Git for Windows' SDK that we use to run the
Coverity build. The symptom is a cryptic error message:

  make: *** [Makefile:2960: headless-git.o] Error 1
  make: *** Waiting for unfinished jobs....
  D:\git-sdk-64-minimal\mingw64\bin\windres.exe: preprocessing failed.
  make: *** [Makefile:2679: git.res] Error 1
  make: *** [Makefile:2893: git.o] Error 1
  make: *** [Makefile:2893: builtin/add.o] Error 1
  Attempting to detect unconfigured compilers in build
  |0----------25-----------50----------75---------100|
  ****************************************************
  Warning:  Build command make.exe exited with code 2. Please verify that the build completed successfully.
  Warning:  Emitted 0 C/C++ compilation units (0%) successfully

  0 C/C++ compilation units (0%) are ready for analysis
   For more details, please look at:
      D:/a/git/git/cov-int/build-log.txt

The log (which the workflow is currently not configured to reveal) then
points out that the `windows.h` header cannot be found, which is _still_
not very helpful. The underlying root cause is that the `gcc.exe` in Git
for Windows' SDK determines the location of the header files via the
location of certain DLL files, and finding the "wrong" ones first on the
`PATH` misleads that logic.

Let's fix this problem by following Coverity's current recommendation
and append the `bin/` directory in which `cov-int` can be found to the
_end_ of `PATH`.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
It is quite helpful to know what Coverity said, exactly, in case it
fails to analyze the code.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
• Replace with phrases that are more standard (“all-or-nothing”
  instead of “-none”)
• Add coordinating words that make it less likely for you to trip
  over the sentence (“*that* "gc" can do”)
• Use “SMTP” instead of both SMTP and smtp
• Don’t mention `git fsck --reference` since the previous release
  was not affected by this minor bug.  Also say “errored out” since
  the git-refs(1) bug was there in v2.48.0 as well
• Use the more widespread “linked” instead of “secondary worktree”

Signed-off-by: Kristoffer Haugsbakk <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Helped-by: 依云 <[email protected]>
Helped-by: Jiang Xin <[email protected]>
Signed-off-by: Teng Long <[email protected]>
Since 6547d1c (bswap.h: add support for built-in bswap
functions, 2025-04-23) tweaked the way the bswap32/64 macros are
defined, on platforms with __builtin_bswap32/64 supported, the
bswap32/64 macros are defined even on big endian platforms.

However the rest of this file assumes that bswap32/64() are defined
ONLY on little endian machines and uses that assumption to redefine
ntohl/ntohll macros. The said commit broke t4014-format-patch.sh test,
among many others on s390x.

Revert the commit.

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
l10n-2.50.0-rnd1

* tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-po:
  l10n: zh_CN: updated translation for 2.50
  l10n: Update German translation
  l10n: uk: add 2.50 translation
  l10n: po-id for 2.50
  l10n: bg.po: Updated Bulgarian translation (5819t)
  l10n: tr: Update Turkish translations for 2.50
  l10n: fr: v2.50 round 1
  l10n: Add full Irish translation (ga.po)
Recently generating the version-def.h file and the config-list.h
file have been updated, which broke versions of "sed" that do not
want to be fed a file that ends with an incomplete line, and/or that
do not understand the more recent "-E" option to use extended
regular expression.

Fix them in response to a build-failure reported on Solaris boxes.

cf. https://lore.kernel.org/git/[email protected]/

Reported-by: Brad Smith <[email protected]>
Reviewed-by: Collin Funk <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Doc mark-up fix for a topic that has graduated to 'master'.

* kh/maintenance-missing-tasks-docfix:
  doc: maintenance: fix linkgit syntax
l10n-2.50.0-v2

* tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-po:
  l10n: zh_TW: update translation for Git 2.50
Build fix.

* jc/sed-build-fixes:
  build: sed portability fixes
Revert a botched bswap.h change that broke ntohll() functions on
big-endian systems with __builtin_bswap32/64().

* ss/revert-builtin-bswap-stuff:
  Revert "bswap.h: add support for built-in bswap functions"
Fixes for GitHub Actions Coverity job.

* js/github-ci-win-coverity-fix:
  ci(coverity): output the build log upon error
  ci(coverity): fix building on Windows
Signed-off-by: Junio C Hamano <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.