<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-02-08T22:05:55Z</updated>
<entry>
<title>Merge branch 'ab/branch-sort' into maint</title>
<updated>2021-02-08T22:05:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-08T22:05:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f2d156dc4891dc1f0e86907fe20d3ac08d3cfde1'/>
<id>urn:sha1:f2d156dc4891dc1f0e86907fe20d3ac08d3cfde1</id>
<content type='text'>
The implementation of "git branch --sort" wrt the detached HEAD
display has always been hacky, which has been cleaned up.

* ab/branch-sort:
  branch: show "HEAD detached" first under reverse sort
  branch: sort detached HEAD based on a flag
  ref-filter: move ref_sorting flags to a bitfield
  ref-filter: move "cmp_fn" assignment into "else if" arm
  ref-filter: add braces to if/else if/else chain
  branch tests: add to --sort tests
  branch: change "--local" to "--list" in comment
</content>
</entry>
<entry>
<title>Merge branch 'ma/more-opaque-lock-file' into maint</title>
<updated>2021-02-08T22:05:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-08T22:05:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=171675a6c5c9e511b05d0db775e8bc9a1194cccf'/>
<id>urn:sha1:171675a6c5c9e511b05d0db775e8bc9a1194cccf</id>
<content type='text'>
Code clean-up.

* ma/more-opaque-lock-file:
  read-cache: try not to peek into `struct {lock_,temp}file`
  refs/files-backend: don't peek into `struct lock_file`
  midx: don't peek into `struct lock_file`
  commit-graph: don't peek into `struct lock_file`
  builtin/gc: don't peek into `struct lock_file`
</content>
</entry>
<entry>
<title>Merge branch 'zh/arg-help-format' into maint</title>
<updated>2021-02-08T22:05:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-08T22:05:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3e52ab222aa3256d9a0ca8d32b49d39d01598996'/>
<id>urn:sha1:3e52ab222aa3256d9a0ca8d32b49d39d01598996</id>
<content type='text'>
Clean up option descriptions in "git cmd --help".

* zh/arg-help-format:
  builtin/*: update usage format
  parse-options: format argh like error messages
</content>
</entry>
<entry>
<title>Merge branch 'ds/for-each-repo-noopfix' into maint</title>
<updated>2021-02-06T00:31:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-06T00:31:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=897d28bcc23878b5d98b46f3903e3d2a302d8a01'/>
<id>urn:sha1:897d28bcc23878b5d98b46f3903e3d2a302d8a01</id>
<content type='text'>
"git for-each-repo --config=&lt;var&gt; &lt;cmd&gt;" should not run &lt;cmd&gt; for
any repository when the configuration variable &lt;var&gt; is not defined
even once.

* ds/for-each-repo-noopfix:
  for-each-repo: do nothing on empty config
</content>
</entry>
<entry>
<title>Merge branch 'en/stash-apply-sparse-checkout' into maint</title>
<updated>2021-02-06T00:31:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-06T00:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a4031f6dc0596670d4f3ce4b905ea8a341e957b4'/>
<id>urn:sha1:a4031f6dc0596670d4f3ce4b905ea8a341e957b4</id>
<content type='text'>
"git stash" did not work well in a sparsely checked out working
tree.

* en/stash-apply-sparse-checkout:
  stash: fix stash application in sparse-checkouts
  stash: remove unnecessary process forking
  t7012: add a testcase demonstrating stash apply bugs in sparse checkouts
</content>
</entry>
<entry>
<title>Merge branch 'rs/rebase-commit-validation' into maint</title>
<updated>2021-02-06T00:31:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-06T00:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a08832f16e56207b2967b51c236f24e180a70107'/>
<id>urn:sha1:a08832f16e56207b2967b51c236f24e180a70107</id>
<content type='text'>
Diagnose command line error of "git rebase" early.

* rs/rebase-commit-validation:
  rebase: verify commit parameter
</content>
</entry>
<entry>
<title>for-each-repo: do nothing on empty config</title>
<updated>2021-01-08T03:12:02Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-01-08T02:30:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6c62f015520eaecd94d93a7e8339b190f2c24bc6'/>
<id>urn:sha1:6c62f015520eaecd94d93a7e8339b190f2c24bc6</id>
<content type='text'>
'git for-each-repo --config=X' should return success without calling any
subcommands when the config key 'X' has no value. The current
implementation instead segfaults.

A user could run into this issue if they used 'git maintenance start' to
initialize their cron schedule using 'git for-each-repo
--config=maintenance.repo ...' but then using 'git maintenance
unregister' to remove the config option. (Note: 'git maintenance stop'
would remove the config _and_ remove the cron schedule.)

Add a simple test to ensure this works. Use 'git help --no-such-option'
as the potential subcommand to ensure that we will hit a failure if the
subcommand is ever run.

Reported-by: Andreas Bühmann &lt;dev@uuml.de&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>branch: sort detached HEAD based on a flag</title>
<updated>2021-01-07T23:13:21Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-01-07T09:51:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2708ce62d2105c4470399a2c839b6d451c9c148f'/>
<id>urn:sha1:2708ce62d2105c4470399a2c839b6d451c9c148f</id>
<content type='text'>
Change the ref-filter sorting of detached HEAD to check the
FILTER_REFS_DETACHED_HEAD flag, instead of relying on the ref
description filled-in by get_head_description() to start with "(",
which in turn we expect to ASCII-sort before any other reference.

For context, we'd like the detached line to appear first at the start
of "git branch -l", e.g.:

    $ git branch -l
    * (HEAD detached at &lt;hash&gt;)
      master

This doesn't change that, but improves on a fix made in
28438e84e04 (ref-filter: sort detached HEAD lines firstly, 2019-06-18)
and gives the Chinese translation the ability to use its preferred
punctuation marks again.

In Chinese the fullwidth versions of punctuation like "()" are
typically written as (U+FF08 fullwidth left parenthesis), (U+FF09
fullwidth right parenthesis) instead[1]. This form is used in both
po/zh_{CN,TW}.po in most cases where "()" is translated in a string.

Aside from that improvement to the Chinese translation, it also just
makes for cleaner code that we mark any special cases in the ref_array
we're sorting with flags and make the sort function aware of them,
instead of piggy-backing on the general-case of strcmp() doing the
right thing.

As seen in the amended tests this made reverse sorting a bit more
consistent. Before this we'd sometimes sort this message in the
middle, now it's consistently at the beginning or end, depending on
whether we're doing a normal or reverse sort. Having it at the end
doesn't make much sense either, but at least it behaves consistently
now. A follow-up commit will make this behavior under reverse sorting
even better.

I'm removing the "TRANSLATORS" comments that were in the old code
while I'm at it. Those were added in d4919bb288e (ref-filter: move
get_head_description() from branch.c, 2017-01-10). I think it's
obvious from context, string and translation memory in typical
translation tools that these are the same or similar string.

1. https://en.wikipedia.org/wiki/Chinese_punctuation#Marks_similar_to_European_punctuation

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: move ref_sorting flags to a bitfield</title>
<updated>2021-01-07T23:13:21Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-01-07T09:51:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c269a7b162027d0465d52203e778903a2ddbdbf'/>
<id>urn:sha1:7c269a7b162027d0465d52203e778903a2ddbdbf</id>
<content type='text'>
Change the reverse/ignore_case/version sort flags in the ref_sorting
struct into a bitfield. Having three of them was already a bit
unwieldy, but it would be even more so if another flag needed a
function like ref_sorting_icase_all() introduced in
76f9e569adb (ref-filter: apply --ignore-case to all sorting keys,
2020-05-03).

A follow-up change will introduce such a flag, so let's move this over
to a bitfield. Instead of using the usual '#define' pattern I'm using
the "enum" pattern from builtin/rebase.c's b4c8eb024af (builtin
rebase: support --quiet, 2018-09-04).

Perhaps there's a more idiomatic way of doing the "for each in list
amend mask" pattern than this "mask/on" variable combo. This function
doesn't allow us to e.g. do any arbitrary changes to the bitfield for
multiple flags, but I think in this case that's fine. The common case
is that we're calling this with a list of one.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>branch: change "--local" to "--list" in comment</title>
<updated>2021-01-06T23:15:39Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-01-06T10:01:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ffdd02a55d994da202acd2c792cc1218bbfa8197'/>
<id>urn:sha1:ffdd02a55d994da202acd2c792cc1218bbfa8197</id>
<content type='text'>
There has never been a "git branch --local", this is just a typo for
"--list". Fixes a comment added in 23e714df91c (branch: roll
show_detached HEAD into regular ref_list, 2015-09-23).

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
