<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/advice.c, branch v2.45.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-04-09T21:31:43Z</updated>
<entry>
<title>Merge branch 'jc/advice-sans-trailing-whitespace'</title>
<updated>2024-04-09T21:31:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-09T21:31:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39b2c6f77ed451ed9ea4080aa878f6d25f21ecc4'/>
<id>urn:sha1:39b2c6f77ed451ed9ea4080aa878f6d25f21ecc4</id>
<content type='text'>
The "hint:" messages given by the advice mechanism, when given a
message with a blank line, left a line with trailing whitespace,
which has been cleansed.

* jc/advice-sans-trailing-whitespace:
  advice: omit trailing whitespace
</content>
</entry>
<entry>
<title>advice: omit trailing whitespace</title>
<updated>2024-03-29T23:18:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-03-29T22:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d8cf94b28de9da683ddd40961a3a572f2741cf3'/>
<id>urn:sha1:2d8cf94b28de9da683ddd40961a3a572f2741cf3</id>
<content type='text'>
Git tools all consistently encourage users to avoid whitespaces at
the end of line by giving them features like "git diff --check" and
"git am --whitespace=fix".  Make sure that the advice messages we
give users avoid trailing whitespaces.  We shouldn't be wasting
vertical screen real estate by adding blank lines in advice messages
that are supposed to be concise hints, but as long as we write such
blank line in our "hints", we should do it right.

A test that expects the current behaviour of leaving trailing
whitespaces has been adjusted.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sequencer: allow disabling conflict advice</title>
<updated>2024-03-18T16:28:40Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2024-03-16T21:16:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec0300914b42277077f51a8c7e3438d7565eb261'/>
<id>urn:sha1:ec0300914b42277077f51a8c7e3438d7565eb261</id>
<content type='text'>
Allow disabling the advice shown when a squencer operation results in a
merge conflict through a new config 'advice.mergeConflict', which is
named generically such that it can be used by other commands eventually.

Remove that final '\n' in the first hunk in sequencer.c to avoid an
otherwise empty 'hint: ' line before the line 'hint: Disable this
message with "git config advice.mergeConflict false"' which is
automatically added by 'advise_if_enabled'.

Note that we use 'advise_if_enabled' for each message in the second hunk
in sequencer.c, instead of using 'if (show_hints &amp;&amp;
advice_enabled(...)', because the former instructs the user how to
disable the advice, which is more user-friendly.

Update the tests accordingly. Note that the body of the second test in
t3507-cherry-pick-conflict.sh is enclosed in double quotes, so we must
escape them in the added line. Note that t5520-pull.sh, which checks
that we display the advice for 'git rebase' (via 'git pull --rebase')
does not have to be updated because it only greps for a specific line in
the advice message.

Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kh/branch-ref-syntax-advice'</title>
<updated>2024-03-15T23:05:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-03-15T23:05:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b09a8839a4a09ab5bea79bcfe892b2591097319a'/>
<id>urn:sha1:b09a8839a4a09ab5bea79bcfe892b2591097319a</id>
<content type='text'>
When git refuses to create a branch because the proposed branch
name is not a valid refname, an advice message is given to refer
the user to exact naming rules.

* kh/branch-ref-syntax-advice:
  branch: advise about ref syntax rules
  advice: use double quotes for regular quoting
  advice: use backticks for verbatim
  advice: make all entries stylistically consistent
  t3200: improve test style
</content>
</entry>
<entry>
<title>branch: advise about ref syntax rules</title>
<updated>2024-03-05T21:04:26Z</updated>
<author>
<name>Kristoffer Haugsbakk</name>
<email>code@khaugsbakk.name</email>
</author>
<published>2024-03-05T20:29:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8fbd903e58503cbdd1f1c816dd0c6c3c4d591b13'/>
<id>urn:sha1:8fbd903e58503cbdd1f1c816dd0c6c3c4d591b13</id>
<content type='text'>
git-branch(1) will error out if you give it a bad ref name. But the user
might not understand why or what part of the name is illegal.

The user might know that there are some limitations based on the *loose
ref* format (filenames), but there are also further rules for
easier integration with shell-based tools, pathname expansion, and
playing well with reference name expressions.

The man page for git-check-ref-format(1) contains these rules. Let’s
advise about it since that is not a command that you just happen
upon. Also make this advise configurable since you might not want to be
reminded every time you make a little typo.

Signed-off-by: Kristoffer Haugsbakk &lt;code@khaugsbakk.name&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge-ort: turn submodule conflict suggestions into an advice</title>
<updated>2024-02-26T18:07:01Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2024-02-26T13:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9e55be7401a5413722299279fc867eb931f4c3b'/>
<id>urn:sha1:b9e55be7401a5413722299279fc867eb931f4c3b</id>
<content type='text'>
Add a new advice type 'submoduleMergeConflict' for the error message
shown when a non-trivial submodule conflict is encountered, which
was added in 4057523a40 (submodule merge: update conflict error
message, 2022-08-04). That commit mentions making this message an
advice as possible future work.  The message can now be disabled
with the advice mechanism.

Update the tests as the expected message now appears on stderr instead
of stdout.

Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>advice: allow disabling the automatic hint in advise_if_enabled()</title>
<updated>2024-01-16T21:07:00Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-01-15T14:28:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d919965af116d145de40853caf0e4228c97da325'/>
<id>urn:sha1:d919965af116d145de40853caf0e4228c97da325</id>
<content type='text'>
Using advise_if_enabled() to display an advice will automatically
include instructions on how to disable the advice, alongside the main
advice:

	hint: use --reapply-cherry-picks to include skipped commits
	hint: Disable this message with "git config advice.skippedCherryPicks false"

To do so, we provide a knob which can be used to disable the advice.

But also to tell us the opposite: to show the advice.

Let's not include the deactivation instructions for an advice if the
user explicitly sets its visibility.

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>branch: make the advice to force-deleting a conditional one</title>
<updated>2024-01-12T01:15:54Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-01-11T12:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bec9bb4b3918d2b3c7b91bbb116a667d5d6d298d'/>
<id>urn:sha1:bec9bb4b3918d2b3c7b91bbb116a667d5d6d298d</id>
<content type='text'>
The error message we show when the user tries to delete a not fully
merged branch describes the error and gives a hint to the user:

	error: the branch 'foo' is not fully merged.
	If you are sure you want to delete it, run 'git branch -D foo'.

Let's move the hint part so that it is displayed using the advice
machinery:

	error: the branch 'foo' is not fully merged
	hint: If you are sure you want to delete it, run 'git branch -D foo'
	hint: Disable this message with "git config advice.forceDeleteBranch false"

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>advice: sort the advice related lists</title>
<updated>2024-01-12T01:15:54Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-01-11T12:40:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3196029b5b6afc5bda3f5514a1ed51a7c7fb7b81'/>
<id>urn:sha1:3196029b5b6afc5bda3f5514a1ed51a7c7fb7b81</id>
<content type='text'>
Let's keep the advice related lists sorted to make them more
digestible.

A multi-line comment has also been changed; that produces the unexpected
'insertion != deletion' in this supposedly 'only sort lines' commit.

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
