Git 2.39 source control release

After two months of development, the distributed source control system Git 2.39 has been released. Git is one of the most popular, reliable, and high-performance version control systems that provides flexible non-linear development tools based on branching and merging branches. To ensure the integrity of the history and resistance to retroactive changes, implicit hashing of the entire previous history in each commit is used, it is also possible to verify individual tags and commits with digital signatures from the developers.

Compared to the previous release, 483 changes were accepted into the new version, prepared with the participation of 86 developers, of which 31 took part in the development for the first time. Main innovations:

  • Added the --group option to the "git shortlog" command, which is intended for displaying summaries with statistics from the change history, for arbitrary grouping of commits by fields not limited to the author or committer. For example, to display a list of developers with information about the number of changes, taking into account the helpers mentioned in the "Co-authored-by" field, you can use the command: git shortlog -ns --group=author --group=trailer:co-authored-by

    The shortlog output can be aggregated using format specifiers, and the "--group" option allows you to significantly simplify the creation of complex reports and get rid of additional sorting commands. For example, to generate a report showing how many commits for a given release were committed in each month, you could use: git shortlog v2.38.0.. --date='format:%Y-%m' --group='%cd' -s 2 2022-08 47 2022-09 405 2022-10 194 2022-11 5 2022-12 Previously, sort and uniq would have been required to perform a similar operation: git log v2.38.0.. --date='format:%Y -%m' --format='%cd' | sort | uniq -c

  • The capabilities of the "cruft packs" mechanism, designed to pack unreachable objects that are not referenced in the repository (branches or tags are not referenced), have been expanded. Unreachable objects are removed by the garbage collector, but remain in the repository for a certain time before removal to avoid race conditions. The β€œcruft packs” mechanism allows you to store all unreachable objects in one pack file, and reflect the data on the modification time of each object in a separate table stored in a separate file with the β€œ.mtimes” extension so that they do not overlap with the total modification time.

    The time that unreachable objects spend in the repository before being actually deleted is determined by the option "--prune= ". That being said, while delaying before deletion is a reasonably effective and practical way to prevent a repository from being corrupted due to a race condition, it is not 100% reliable. To make it easier to recover a broken repository, the new release provides the ability to save missing objects by adding the "--expire-to" option to the "git repack" command, which allows you to specify a file to create an external copy of all deleted objects. For example, to save unreachable objects in the backup.git file that have not changed in the last 5 minutes, you can use the command: git repack --cruft --cruft-expiration=5.minutes.ago -d --expire-to=../backup.git

  • Significantly increased (up to 70%) the speed of the "git grep --cached" operation when searching in areas that use partial cloning (sparse-checkout) and for which there are partial indexes (sparse index). Previously, when specifying the "--cached" option, the regular index was searched first, and then the partial ones, which led to noticeable delays when searching large repositories.
  • Faster execution on the server of checking the connectivity of new objects before they are placed in the repository when performing the "git push" operation. Due to the transition to taking into account when checking only declared links, in a test repository with 7 million links, of which only 3% are covered by the push operation, the optimizations made it possible to reduce the check time by 4.5 times.
  • To guard against potential integer overflows in code, the "git apply" command limits the maximum size of patches that can be processed. If the patch size exceeds 1 GB, an error will now be displayed.
  • To protect against potential vulnerabilities, changes have been made to clean up unnecessary information from headers set when using the h2h3 module with the GIT_TRACE_CURL=1 or GIT_CURL_VERBOSE=1 option along with HTTP/2.
  • When performing a check out operation on a branch that is a symbolic link to another branch, the "git symbolic-ref HEAD" command now prints the name of the target branch rather than the name of the symbolic link.
  • Added support for the @{-1} argument to the "--edit-description" ("git branch --edit-description @{-1}") option to edit the description of a past branch.
  • Added "git merge-tree --stdin" command to pass parameter list via standard input.
  • On network file systems, the fsmonitor handler, which monitors changes in the file system, is disabled by default.

Source: opennet.ru

Add a comment