<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-reset.txt, branch v2.43.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.43.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.43.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-01-13T17:55:45Z</updated>
<entry>
<title>git-reset.txt: mention 'ORIG_HEAD' in the Description</title>
<updated>2023-01-13T17:55:45Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2023-01-10T13:15:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d03c773cf6c9d425a8d25af7a45775e280fd6d81'/>
<id>urn:sha1:d03c773cf6c9d425a8d25af7a45775e280fd6d81</id>
<content type='text'>
The fact that 'git reset' writes 'ORIG_HEAD' before changing HEAD is
mentioned in an example, but is missing from the 'Description' section.

Mention it in the discussion of the "'git reset' [&lt;mode&gt;] [&lt;commit&gt;]"
form of the command.

Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Acked-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reset: remove 'reset.refresh' config option</title>
<updated>2022-03-23T21:39:45Z</updated>
<author>
<name>Victoria Dye</name>
<email>vdye@github.com</email>
</author>
<published>2022-03-23T18:18:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cff6765fe5c1ce97f4afba9432c8aa5c5f877ba'/>
<id>urn:sha1:7cff6765fe5c1ce97f4afba9432c8aa5c5f877ba</id>
<content type='text'>
Remove the 'reset.refresh' option, requiring that users explicitly specify
'--no-refresh' if they want to skip refreshing the index.

The 'reset.refresh' option was introduced in 101cee42dd (reset: introduce
--[no-]refresh option to --mixed, 2022-03-11) as a replacement for the
refresh-skipping behavior originally controlled by 'reset.quiet'.

Although 'reset.refresh=false' functionally served the same purpose as
'reset.quiet=true', it exposed [1] the fact that the existence of a global
"skip refresh" option could potentially cause problems for users. Allowing a
global config option to avoid refreshing the index forces scripts using 'git
reset --mixed' to defensively use '--refresh' if index refresh is expected;
if that option is missing, behavior of a script could vary from user-to-user
without explanation.

Furthermore, globally disabling index refresh in 'reset --mixed' was
initially devised as a passive performance improvement; since the
introduction of the option, other changes have been made to Git (e.g., the
sparse index) with a greater potential performance impact without
sacrificing index correctness. Therefore, we can more aggressively err on
the side of correctness and limit the cases of skipping index refresh to
only when a user specifies the '--no-refresh' option.

[1] https://lore.kernel.org/git/xmqqy2179o3c.fsf@gitster.g/

Signed-off-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reset: remove 'reset.quiet' config option</title>
<updated>2022-03-23T21:39:45Z</updated>
<author>
<name>Victoria Dye</name>
<email>vdye@github.com</email>
</author>
<published>2022-03-23T18:17:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2efc9b84e5e9ea063ecfb2f813cb56653a03c10a'/>
<id>urn:sha1:2efc9b84e5e9ea063ecfb2f813cb56653a03c10a</id>
<content type='text'>
Remove the 'reset.quiet' config option, remove '--no-quiet' documentation in
'Documentation/git-reset.txt'. In 4c3abd0551 (reset: add new reset.quiet
config setting, 2018-10-23), 'reset.quiet' was introduced as a way to
globally change the default behavior of 'git reset --mixed' to skip index
refresh.

However, now that '--quiet' does not affect index refresh, 'reset.quiet'
would only serve to globally silence logging. This was not the original
intention of the config setting, and there's no precedent for such a setting
in other commands with a '--quiet' option, so it appears to be obsolete.

In addition to the options &amp; its documentation, remove 'reset.quiet' from
the recommended config for 'scalar'.

Signed-off-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reset: do not make '--quiet' disable index refresh</title>
<updated>2022-03-23T21:39:44Z</updated>
<author>
<name>Victoria Dye</name>
<email>vdye@github.com</email>
</author>
<published>2022-03-23T18:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=45bf76284b40856e47e8809e952167f0316b8a99'/>
<id>urn:sha1:45bf76284b40856e47e8809e952167f0316b8a99</id>
<content type='text'>
Update '--quiet' to no longer implicitly skip refreshing the index in a
mixed reset. Users now have the ability to explicitly disable refreshing the
index with the '--no-refresh' option, so they no longer need to use
'--quiet' to do so. Moreover, we explicitly remove the refresh-skipping
behavior from '--quiet' because it is completely unrelated to the stated
purpose of the option: "Be quiet, only report errors."

Helped-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reset: introduce --[no-]refresh option to --mixed</title>
<updated>2022-03-15T01:51:56Z</updated>
<author>
<name>Victoria Dye</name>
<email>vdye@github.com</email>
</author>
<published>2022-03-15T01:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd56fba97f26bf668749207efd6a45aee2e2f57c'/>
<id>urn:sha1:fd56fba97f26bf668749207efd6a45aee2e2f57c</id>
<content type='text'>
Add a new --[no-]refresh option that is intended to explicitly determine
whether a mixed reset should end in an index refresh.

Starting at 9ac8125d1a (reset: don't compute unstaged changes after reset
when --quiet, 2018-10-23), using the '--quiet' option results in skipping
the call to 'refresh_index(...)' at the end of a mixed reset with the goal
of improving performance. However, by coupling behavior that modifies the
index with the option that silences logs, there is no way for users to have
one without the other (i.e., silenced logs with a refreshed index) without
incurring the overhead of a separate call to 'git update-index --refresh'.
Furthermore, there is minimal user-facing documentation indicating that
--quiet skips the index refresh, potentially leading to unexpected issues
executing commands after 'git reset --quiet' that do not themselves refresh
the index (e.g., internals of 'git stash', 'git read-tree').

To mitigate these issues, '--[no-]refresh' and 'reset.refresh' are
introduced to provide a dedicated mechanism for refreshing the index. When
either is set, '--quiet' and 'reset.quiet' revert to controlling only
whether logs are silenced and do not affect index refresh.

Helped-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Documentation: call out commands that nuke untracked files/directories</title>
<updated>2021-09-27T20:38:37Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-09-27T16:33:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e29222e0c2f68118cdd3412515539b74433b732'/>
<id>urn:sha1:0e29222e0c2f68118cdd3412515539b74433b732</id>
<content type='text'>
Some commands have traditionally also removed untracked files (or
directories) that were in the way of a tracked file we needed.  Document
these cases.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: document --recurse-submodules for reset and restore</title>
<updated>2020-04-06T20:42:43Z</updated>
<author>
<name>Damien Robert</name>
<email>damien.olivier.robert@gmail.com</email>
</author>
<published>2020-04-06T13:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b3cec57338db7b01681716d072f36c29b7f770f4'/>
<id>urn:sha1:b3cec57338db7b01681716d072f36c29b7f770f4</id>
<content type='text'>
Also unify the formulation about --no-recurse-submodules for checkout
and switch, which we reuse for restore.

And correct the formulation about submodules' HEAD in read-tree, which
we reuse in reset.

Signed-off-by: Damien Robert &lt;damien.olivier.robert+git@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reset: support the `--pathspec-from-file` option</title>
<updated>2019-11-20T04:01:53Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2019-11-19T16:48:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64bac8df972782b3b3dd2841699f076c7573c1db'/>
<id>urn:sha1:64bac8df972782b3b3dd2841699f076c7573c1db</id>
<content type='text'>
Decisions taken for simplicity:
1) For now, `--pathspec-from-file` is declared incompatible with
   `--patch`, even when &lt;file&gt; is not `stdin`. Such use case it not
   really expected. Also, it is harder to support in `git commit`, so
   I decided to make it incompatible in all places.
2) It is not allowed to pass pathspec in both args and file.

Co-authored-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Alexandr Miloslavskiy &lt;alexandr.miloslavskiy@syntevo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: reset: synchronize &lt;pathspec&gt; description</title>
<updated>2019-11-20T04:01:53Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2019-11-19T16:48:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d137b5075660d633ef93342974350f1d0657a54c'/>
<id>urn:sha1:d137b5075660d633ef93342974350f1d0657a54c</id>
<content type='text'>
`git add` shows an example of good writing, follow it.

Signed-off-by: Alexandr Miloslavskiy &lt;alexandr.miloslavskiy@syntevo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/switch-and-restore'</title>
<updated>2019-07-09T22:25:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-07-09T22:25:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f496b064fc1135e0dded7f93d85d72eb0b302c22'/>
<id>urn:sha1:f496b064fc1135e0dded7f93d85d72eb0b302c22</id>
<content type='text'>
Two new commands "git switch" and "git restore" are introduced to
split "checking out a branch to work on advancing its history" and
"checking out paths out of the index and/or a tree-ish to work on
advancing the current history" out of the single "git checkout"
command.

* nd/switch-and-restore: (46 commits)
  completion: disable dwim on "git switch -d"
  switch: allow to switch in the middle of bisect
  t2027: use test_must_be_empty
  Declare both git-switch and git-restore experimental
  help: move git-diff and git-reset to different groups
  doc: promote "git restore"
  user-manual.txt: prefer 'merge --abort' over 'reset --hard'
  completion: support restore
  t: add tests for restore
  restore: support --patch
  restore: replace --force with --ignore-unmerged
  restore: default to --source=HEAD when only --staged is specified
  restore: reject invalid combinations with --staged
  restore: add --worktree and --staged
  checkout: factor out worktree checkout code
  restore: disable overlay mode by default
  restore: make pathspec mandatory
  restore: take tree-ish from --source option instead
  checkout: split part of it to new command 'restore'
  doc: promote "git switch"
  ...
</content>
</entry>
</feed>
