<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/advice.c, 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-08-07T20:21:00Z</updated>
<entry>
<title>advice: handle "rebase" in error_resolve_conflict()</title>
<updated>2023-08-07T20:21:00Z</updated>
<author>
<name>Oswald Buddenhagen</name>
<email>oswald.buddenhagen@gmx.de</email>
</author>
<published>2023-08-07T17:09:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ff29a61cbbc83f0948606df37dbc734436b62c17'/>
<id>urn:sha1:ff29a61cbbc83f0948606df37dbc734436b62c17</id>
<content type='text'>
This makes sure that we get a properly translated message rather than
inserting the command (which we failed to translate) into a generic
fallback message.

The function is called indirectly via die_resolve_conflict() with fixed
strings, and directly with the string obtained via action_name(), which
in turn returns a string from a fixed set. Hence we know that the now
covered set of strings is exhausitive, and will therefore BUG() out when
encountering an unexpected string. We also know that all covered strings
are actually used.

Arguably, the above suggests that it would be cleaner to pass the
command as an enum in the first place, but that's left for another time.

Signed-off-by: Oswald Buddenhagen &lt;oswald.buddenhagen@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree add: introduce "try --orphan" hint</title>
<updated>2023-05-17T22:55:24Z</updated>
<author>
<name>Jacob Abel</name>
<email>jacobabel@nullpo.dev</email>
</author>
<published>2023-05-17T21:48:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35f0383ca61db8f0b6ee1e9002150bbb13649993'/>
<id>urn:sha1:35f0383ca61db8f0b6ee1e9002150bbb13649993</id>
<content type='text'>
Add a new advice/hint in `git worktree add` for when the user
tries to create a new worktree from a reference that doesn't exist.

Current Behavior:

% git init foo
Initialized empty Git repository in /path/to/foo/
% touch file
% git -C foo commit -q -a -m "test commit"
% git -C foo switch --orphan norefbranch
% git -C foo worktree add newbranch/
Preparing worktree (new branch 'newbranch')
fatal: invalid reference: HEAD
%

New Behavior:

% git init --bare foo
Initialized empty Git repository in /path/to/foo/
% touch file
% git -C foo commit -q -a -m "test commit"
% git -C foo switch --orphan norefbranch
% git -C foo worktree add newbranch/
Preparing worktree (new branch 'newbranch')
hint: If you meant to create a worktree containing a new orphan branch
hint: (branch with no commits) for this repository, you can do so
hint: using the --orphan option:
hint:
hint:   git worktree add --orphan newbranch/
hint:
hint: Disable this message with "git config advice.worktreeAddOrphan false"
fatal: invalid reference: HEAD
% git -C foo worktree add -b newbranch2 new_wt/
Preparing worktree (new branch 'newbranch')
hint: If you meant to create a worktree containing a new orphan branch
hint: (branch with no commits) for this repository, you can do so
hint: using the --orphan option:
hint:
hint:   git worktree add --orphan -b newbranch2 new_wt/
hint:
hint: Disable this message with "git config advice.worktreeAddOrphan false"
fatal: invalid reference: HEAD
%

Signed-off-by: Jacob Abel &lt;jacobabel@nullpo.dev&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fc/advice-diverged-history'</title>
<updated>2023-03-19T22:03:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-03-19T22:03:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9de14c71f720b1da50c95309fc06d30c8455aae2'/>
<id>urn:sha1:9de14c71f720b1da50c95309fc06d30c8455aae2</id>
<content type='text'>
After "git pull" that is configured with pull.rebase=false
merge.ff=only fails due to our end having our own development, give
advice messages to get out of the "Not possible to fast-forward"
state.

* fc/advice-diverged-history:
  advice: add diverging advice for novices
</content>
</entry>
<entry>
<title>advice: add diverging advice for novices</title>
<updated>2023-03-08T17:28:42Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2023-03-08T02:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=765071a8f27fcaae27ce940b3a784b9d586faa12'/>
<id>urn:sha1:765071a8f27fcaae27ce940b3a784b9d586faa12</id>
<content type='text'>
The user might not necessarily know why ff only was configured, maybe an
admin did it, or the installer (Git for Windows), or perhaps they just
followed some online advice.

This can happen not only on pull.ff=only, but merge.ff=only too.

Even worse if the user has configured pull.rebase=false and
merge.ff=only, because in those cases a diverging merge will constantly
keep failing. There's no trivial way to get out of this other than
`git merge --no-ff`.

Let's not assume our users are experts in git who completely understand
all their configurations.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Acked-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: replace cache.h with more direct headers, where possible</title>
<updated>2023-02-24T01:25:30Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-02-24T00:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc7bd51b06424694c2e3dd97c11fa095d84d52b1'/>
<id>urn:sha1:fc7bd51b06424694c2e3dd97c11fa095d84d52b1</id>
<content type='text'>
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>advice.h: add advise_on_moving_dirty_path()</title>
<updated>2022-08-10T20:57:50Z</updated>
<author>
<name>Shaoxuan Yuan</name>
<email>shaoxuan.yuan02@gmail.com</email>
</author>
<published>2022-08-09T12:09:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5efd533ed8896592740afe22ac07271497d6db36'/>
<id>urn:sha1:5efd533ed8896592740afe22ac07271497d6db36</id>
<content type='text'>
Add an advice.

When the user use `git mv --sparse &lt;dirty-path&gt; &lt;destination&gt;`, Git
will warn the user to use `git add --sparse &lt;paths&gt;` then use
`git sparse-checkout reapply` to apply the sparsity rules.

Add a few lines to previous "move dirty path" tests so we can test
this new advice is working.

Suggested-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Shaoxuan Yuan &lt;shaoxuan.yuan02@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tk/ambiguous-fetch-refspec'</title>
<updated>2022-04-04T17:56:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-04T17:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba2452b247dfd455bccbcb04acdcfd142cb5397e'/>
<id>urn:sha1:ba2452b247dfd455bccbcb04acdcfd142cb5397e</id>
<content type='text'>
Give hint when branch tracking cannot be established because fetch
refspecs from multiple remote repositories overlap.

* tk/ambiguous-fetch-refspec:
  tracking branches: add advice to ambiguous refspec error
</content>
</entry>
<entry>
<title>tracking branches: add advice to ambiguous refspec error</title>
<updated>2022-04-01T17:09:18Z</updated>
<author>
<name>Tao Klerks</name>
<email>tao@klerks.biz</email>
</author>
<published>2022-04-01T06:05:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e4921d877ab3487fbc0bde8b3e59b757d274783c'/>
<id>urn:sha1:e4921d877ab3487fbc0bde8b3e59b757d274783c</id>
<content type='text'>
The error "not tracking: ambiguous information for ref" is raised
when we are evaluating what tracking information to set on a branch,
and find that the ref to be added as tracking branch is mapped
under multiple remotes' fetch refspecs.

This can easily happen when a user copy-pastes a remote definition
in their git config, and forgets to change the tracking path.

Add advice in this situation, explicitly highlighting which remotes
are involved and suggesting how to correct the situation. Also
update a test to explicitly expect that advice.

Signed-off-by: Tao Klerks &lt;tao@klerks.biz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reset: replace '--quiet' with '--no-refresh' in performance advice</title>
<updated>2022-03-15T01:51:56Z</updated>
<author>
<name>Victoria Dye</name>
<email>vdye@github.com</email>
</author>
<published>2022-03-15T01:49:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9396251b371b9475b60461ddb27bd22282c86d79'/>
<id>urn:sha1:9396251b371b9475b60461ddb27bd22282c86d79</id>
<content type='text'>
Replace references to '--quiet' with '--no-refresh' in the advice on how to
skip refreshing the index. When the advice was introduced, '--quiet' was the
only way to avoid the expensive 'refresh_index(...)' at the end of a mixed
reset. After introducing '--no-refresh', however, '--quiet' became only a
fallback option for determining refresh behavior, overridden by
'--[no-]refresh' or 'reset.refresh' if either is set. To ensure users are
advised to use the most reliable option for avoiding 'refresh_index(...)',
replace recommendation of '--quiet' with '--[no-]refresh'.

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>switch: mention the --detach option when dying due to lack of a branch</title>
<updated>2022-02-26T06:21:48Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2022-02-26T06:12:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=808213ba36ea72408cc45117a825ad9a714535ba'/>
<id>urn:sha1:808213ba36ea72408cc45117a825ad9a714535ba</id>
<content type='text'>
Users who are accustomed to doing `git checkout &lt;tag&gt;` assume that
`git switch &lt;tag&gt;` will do the same thing. Inform them of the --detach
option so they aren't left wondering why `git switch` doesn't work but
`git checkout` does.

Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
