<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/sequencer.c, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-06-08T21:27:52Z</updated>
<entry>
<title>Merge branch 'rs/commit-summary-wo-break-rewrite' into maint</title>
<updated>2022-06-08T21:27:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-06-08T21:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac8f6b6608315ea11d64ba331ea39cf985f577f5'/>
<id>urn:sha1:ac8f6b6608315ea11d64ba331ea39cf985f577f5</id>
<content type='text'>
The commit summary shown after making a commit is matched to what
is given in "git status" not to use the break-rewrite heuristics.
source: &lt;c35bd0aa-2e46-e710-2b39-89f18bad0097@web.de&gt;

* rs/commit-summary-wo-break-rewrite:
  commit, sequencer: turn off break_opt for commit summary
</content>
</entry>
<entry>
<title>Revert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'"</title>
<updated>2022-04-13T22:51:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-13T22:51:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c6da34a610e58f7e58042b5ed24a19bd2c18e928'/>
<id>urn:sha1:c6da34a610e58f7e58042b5ed24a19bd2c18e928</id>
<content type='text'>
This reverts commit 991b4d47f0accd3955d05927d5ce434e03ffbdb6, reversing
changes made to bcd020f88e1e22f38422ac3f73ab06b34ec4bef1.
</content>
</entry>
<entry>
<title>commit, sequencer: turn off break_opt for commit summary</title>
<updated>2022-04-06T14:56:21Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2022-04-04T21:08:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=84792322ed9e79c3152d9443ab6609710db4b26a'/>
<id>urn:sha1:84792322ed9e79c3152d9443ab6609710db4b26a</id>
<content type='text'>
dc6b1d92ca (wt-status: use settings from git_diff_ui_config, 2018-05-04)
disabled diffopt.break_opt for diffstats shown by git status and in
commit templates.  For git status there isn't even a way to enable it.
Make the commit summary (shown after the commit) consistent by disabling
it there as well.

Reported-by: Laurent Lyaudet &lt;laurent.lyaudet@gmail.com&gt;
Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/in-place-reverse-in-sequencer'</title>
<updated>2022-03-23T21:09:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-23T21:09:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=83510335c6f6c26089aaba8e40ef063ee68fa840'/>
<id>urn:sha1:83510335c6f6c26089aaba8e40ef063ee68fa840</id>
<content type='text'>
Code clean-up.

* js/in-place-reverse-in-sequencer:
  sequencer: use reverse_commit_list() helper
</content>
</entry>
<entry>
<title>sequencer: use reverse_commit_list() helper</title>
<updated>2022-03-16T15:39:16Z</updated>
<author>
<name>Jayati Shrivastava</name>
<email>gaurijove@gmail.com</email>
</author>
<published>2022-03-16T11:20:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5327d8982a467c0043d2900d2afcfc21ef14820e'/>
<id>urn:sha1:5327d8982a467c0043d2900d2afcfc21ef14820e</id>
<content type='text'>
Instead of creating a new allocation, reverse the original list
in-place by calling the reverse_commit_list() helper.

The original code discards the list "bases" after storing its
reverse copy in a newly created list "reversed".  If the code that
followed from here used both "bases" and "reversed", the
modification would not have worked, but since the original list
"bases" gets discarded, we can simply reverse "bases" in-place with
the reverse_commit_list() helper and reuse the same variable in the
code that follows.

builtin/merge.c has been left unmodified, since in its case, the
original list is needed separately from its reverse copy by the
code.

Signed-off-by: Jayati Shrivastava &lt;gaurijove@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hooks: fix an obscure TOCTOU "did we just run a hook?" race</title>
<updated>2022-03-07T21:00:53Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-07T12:33:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a8cc594333848713b8e772cccf8159196ea85ede'/>
<id>urn:sha1:a8cc594333848713b8e772cccf8159196ea85ede</id>
<content type='text'>
Fix a Time-of-check to time-of-use (TOCTOU) race in code added in
680ee550d72 (commit: skip discarding the index if there is no
pre-commit hook, 2017-08-14).

This obscure race condition can occur if we e.g. ran the "pre-commit"
hook and it modified the index, but hook_exists() returns false later
on (e.g., because the hook itself went away, the directory became
unreadable, etc.). Then we won't call discard_cache() when we should
have.

The race condition itself probably doesn't matter, and users would
have been unlikely to run into it in practice. This problem has been
noted on-list when 680ee550d72 was discussed[1], but had not been
fixed.

This change is mainly intended to improve the readability of the code
involved, and to make reasoning about it more straightforward. It
wasn't as obvious what we were trying to do here, but by having an
"invoked_hook" it's clearer that e.g. our discard_cache() is happening
because of the earlier hook execution.

Let's also change this for the push-to-checkout hook. Now instead of
checking if the hook exists and either doing a push to checkout or a
push to deploy we'll always attempt a push to checkout. If the hook
doesn't exist we'll fall back on push to deploy. The same behavior as
before, without the TOCTOU race. See 0855331941b (receive-pack:
support push-to-checkout hook, 2014-12-01) for the introduction of the
previous behavior.

This leaves uses of hook_exists() in two places that matter. The
"reference-transaction" check in refs.c, see 67541597670 (refs:
implement reference transaction hook, 2020-06-19), and the
"prepare-commit-msg" hook, see 66618a50f9c (sequencer: run
'prepare-commit-msg' hook, 2018-01-24).

In both of those cases we're saving ourselves CPU time by not
preparing data for the hook that we'll then do nothing with if we
don't have the hook. So using this "invoked_hook" pattern doesn't make
sense in those cases.

The "reference-transaction" and "prepare-commit-msg" hook also aren't
racy. In those cases we'll skip the hook runs if we race with a new
hook being added, whereas in the TOCTOU races being fixed here we were
incorrectly skipping the required post-hook logic.

1. https://lore.kernel.org/git/20170810191613.kpmhzg4seyxy3cpq@sigill.intra.peff.net/

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>Merge branch 'ja/i18n-common-messages'</title>
<updated>2022-02-25T23:47:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-25T23:47:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d21d5ddfe675f9dbcdbb94ab01776115a2d1fdde'/>
<id>urn:sha1:d21d5ddfe675f9dbcdbb94ab01776115a2d1fdde</id>
<content type='text'>
Unify more messages to help l10n.

* ja/i18n-common-messages:
  i18n: fix some misformated placeholders in command synopsis
  i18n: remove from i18n strings that do not hold translatable parts
  i18n: factorize "invalid value" messages
  i18n: factorize more 'incompatible options' messages
</content>
</entry>
<entry>
<title>Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'</title>
<updated>2022-02-18T21:53:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-18T21:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=991b4d47f0accd3955d05927d5ce434e03ffbdb6'/>
<id>urn:sha1:991b4d47f0accd3955d05927d5ce434e03ffbdb6</id>
<content type='text'>
Because a deletion of ref would need to remove it from both the
loose ref store and the packed ref store, a delete-ref operation
that logically removes one ref may end up invoking ref-transaction
hook twice, which has been corrected.

* ps/avoid-unnecessary-hook-invocation-with-packed-refs:
  refs: skip hooks when deleting uncovered packed refs
  refs: do not execute reference-transaction hook on packing refs
  refs: demonstrate excessive execution of the reference-transaction hook
  refs: allow skipping the reference-transaction hook
  refs: allow passing flags when beginning transactions
  refs: extract packed_refs_delete_refs() to allow control of transaction
</content>
</entry>
<entry>
<title>Merge branch 'pw/use-in-process-checkout-in-rebase'</title>
<updated>2022-02-18T21:53:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-18T21:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bcd020f88e1e22f38422ac3f73ab06b34ec4bef1'/>
<id>urn:sha1:bcd020f88e1e22f38422ac3f73ab06b34ec4bef1</id>
<content type='text'>
Use an internal call to reset_head() helper function instead of
spawning "git checkout" in "rebase", and update code paths that are
involved in the change.

* pw/use-in-process-checkout-in-rebase:
  rebase -m: don't fork git checkout
  rebase --apply: set ORIG_HEAD correctly
  rebase --apply: fix reflog
  reset_head(): take struct rebase_head_opts
  rebase: cleanup reset_head() calls
  create_autostash(): remove unneeded parameter
  reset_head(): make default_reflog_action optional
  reset_head(): factor out ref updates
  reset_head(): remove action parameter
  rebase --apply: don't run post-checkout hook if there is an error
  rebase: do not remove untracked files on checkout
  rebase: pass correct arguments to post-checkout hook
  t5403: refactor rebase post-checkout hook tests
  rebase: factor out checkout for up to date branch
</content>
</entry>
<entry>
<title>Merge branch 'ab/no-errno-from-resolve-ref-unsafe'</title>
<updated>2022-02-12T00:55:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-12T00:55:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03bdcfcc78f476d58449c9635e95916b7b71f3dd'/>
<id>urn:sha1:03bdcfcc78f476d58449c9635e95916b7b71f3dd</id>
<content type='text'>
Remaining code-clean-up.

* ab/no-errno-from-resolve-ref-unsafe:
  refs API: remove "failure_errno" from refs_resolve_ref_unsafe()
  sequencer: don't use die_errno() on refs_resolve_ref_unsafe() failure
</content>
</entry>
</feed>
