<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-11-30T00:58:06Z</updated>
<entry>
<title>completion: add case-insensitive match of pseudorefs</title>
<updated>2022-11-30T00:58:06Z</updated>
<author>
<name>Alison Winters</name>
<email>alisonatwork@outlook.com</email>
</author>
<published>2022-11-21T00:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9de31f7bd25029eb6e2292ede6df3a646f261de4'/>
<id>urn:sha1:9de31f7bd25029eb6e2292ede6df3a646f261de4</id>
<content type='text'>
When GIT_COMPLETION_IGNORE_CASE is set, also allow lowercase completion
text like "head" to match uppercase HEAD and other pseudorefs.

Signed-off-by: Alison Winters &lt;alisonatwork@outlook.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: add optional ignore-case when matching refs</title>
<updated>2022-11-30T00:58:06Z</updated>
<author>
<name>Alison Winters</name>
<email>alisonatwork@outlook.com</email>
</author>
<published>2022-11-21T00:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9bab766fb28fae57a229bd90558ec4453ca71be9'/>
<id>urn:sha1:9bab766fb28fae57a229bd90558ec4453ca71be9</id>
<content type='text'>
If GIT_COMPLETION_IGNORE_CASE is set, --ignore-case will be added to
git for-each-ref calls so that refs can be matched case insensitively,
even when running on case sensitive filesystems.

Signed-off-by: Alison Winters &lt;alisonatwork@outlook.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-prompt: show presence of unresolved conflicts at command prompt</title>
<updated>2022-08-19T17:58:40Z</updated>
<author>
<name>Justin Donnelly</name>
<email>justinrdonnelly@gmail.com</email>
</author>
<published>2022-08-17T00:18:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e03acd0d4ad75115f454041fac3300ae796f108f'/>
<id>urn:sha1:e03acd0d4ad75115f454041fac3300ae796f108f</id>
<content type='text'>
If GIT_PS1_SHOWCONFLICTSTATE is set to "yes", show the word "CONFLICT"
on the command prompt when there are unresolved conflicts.

Example prompt: (main|CONFLICT)

Signed-off-by: Justin Donnelly &lt;justinrdonnelly@gmail.com&gt;
Acked-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-prompt: fix expansion of branch colour codes</title>
<updated>2022-06-10T16:41:49Z</updated>
<author>
<name>Joakim Petersen</name>
<email>joak-pet@online.no</email>
</author>
<published>2022-06-10T00:47:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e5d9ef395467619b621540a7fdefbfc8062f2ac'/>
<id>urn:sha1:0e5d9ef395467619b621540a7fdefbfc8062f2ac</id>
<content type='text'>
Because of the wrapping of the branch name variable $b, the colour codes
in the variable don't get applied, but are instead printed directly in
the output. Move the wrapping of $b to before colour codes are inserted
to correct this. Revert move of branch name colour codes in tests, as
the branch name is now coloured after the wrapping instead of before.

Signed-off-by: Joakim Petersen &lt;joak-pet@online.no&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-prompt: make colourization consistent</title>
<updated>2022-06-07T16:08:39Z</updated>
<author>
<name>Joakim Petersen</name>
<email>joak-pet@online.no</email>
</author>
<published>2022-06-07T11:50:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9470605a1b03dac8fc4f801132e36964b4fbb8c3'/>
<id>urn:sha1:9470605a1b03dac8fc4f801132e36964b4fbb8c3</id>
<content type='text'>
The short upstream state indicator inherits the colour of the last short
state indicator before it (if there is one), and the sparsity state
indicator inherits this colour as well. This behaviour was introduced by
0ec7c23cdc6 (git-prompt: make upstream state indicator location
consistent, 2022-02-27), while before this change the aforementioned
indicators were white/the default text colour. Some examples to
illustrate this behaviour (assuming all indicators are enabled and
colourization is on):
 * If there is something in the stash, both the '$' and the short
   upstream state indicator following it will be blue.
 * If the local tree has new, untracked files and there is nothing in
   the stash, both the '%' and the short upstream state indicator
   will be red.
 * If all local changes are added to the index and the stash is empty,
   both the '+' and the short upstream state indicator following it will
   be green.
 * If the local tree is clean and there is nothing in the stash, the
   short upstream state indicator will be white/${default text colour}.

This appears to be an unintended side-effect of the change, and makes
little sense semantically (e.g. why is it bad to be in sync with
upstream when you have uncommitted local changes?). The cause of the
change in colourization is that previously, the short upstream state
indicator appeared immediately after the rebase/revert/bisect/merge
state indicator (note the position of $p in $gitstring):

	local f="$h$w$i$s$u"
	local gitstring="$c$b${f:+$z$f}${sparse}$r$p"

Said indicator is prepended with the clear colour code, and the short
upstream state indicator is thus also uncoloured. Now, the short
upstream state indicator follows the sequence of colourized indicators,
without any clearing of colour (again note the position of $p, now in
$f):

	local f="$h$w$i$s$u$p"
	local gitstring="$c$b${f:+$z$f}${sparse}$r${upstream}"

If the user is in a sparse checkout, the sparsity state indicator
follows a similar pattern to the short upstream state indicator.
However, clearing colour of the colourized indicators changes how the
sparsity state indicator is colourized, as it currently inherits (and
before the change referenced also inherited) the colour of the last
short state indicator before it. Reading the commit message of the
change that introduced the sparsity state indicator, afda36dbf3b
(git-prompt: include sparsity state as well, 2020-06-21), it appears
this colourization also was unintended, so clearing the colour for said
indicator further increases consistency.

Make the colourization of these state indicators consistent by making
all colourized indicators clear their own colour. Make colouring of $c
dependent on it not being empty, as it is no longer being used to colour
the branch name. Move clearing of $b's prefix to before colourization so
it gets cleared properly when colour codes are inserted into it. These
changes make changing the layout of the prompt less prone to unintended
colour changes in the future.

Change coloured Bash prompt tests to reflect the colourization changes:
 * Move the colour codes to wrap the expected content of the expanded
   $__git_ps1_branch_name in all tests.
 * Insert a clear-colour code after the symbol for the first indicator
   in "prompt - bash color pc mode - dirty status indicator - dirty
   index and worktree", to reflect that all indicators should clear
   their own colour.

Signed-off-by: Joakim Petersen &lt;joak-pet@online.no&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jd/prompt-upstream-mark'</title>
<updated>2022-03-31T01:01:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-31T01:01:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ea7e40c53512c410cfc769f6817d31c3bec9941'/>
<id>urn:sha1:2ea7e40c53512c410cfc769f6817d31c3bec9941</id>
<content type='text'>
Tweaks in the command line prompt (in contrib/) code around its
GIT_PS1_SHOWUPSTREAM feature.

* jd/prompt-upstream-mark:
  git-prompt: put upstream comments together
  git-prompt: make long upstream state indicator consistent
  git-prompt: make upstream state indicator location consistent
  git-prompt: rename `upstream` to `upstream_type`
</content>
</entry>
<entry>
<title>git-prompt: put upstream comments together</title>
<updated>2022-03-23T20:07:50Z</updated>
<author>
<name>Justin Donnelly</name>
<email>justinrdonnelly@gmail.com</email>
</author>
<published>2022-02-27T19:57:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=094b5409eadd064110f3e74d880fad91e9ca0f0b'/>
<id>urn:sha1:094b5409eadd064110f3e74d880fad91e9ca0f0b</id>
<content type='text'>
Commit 6d158cba28 (bash completion: Support "divergence from upstream"
messages in __git_ps1, 2010-06-17) introduced support for indicating
divergence from upstream in the PS1 prompt. The comments at the top of
git-prompt.sh that were introduced with that commit are several
paragraphs long. Over the years, other comments have been inserted in
between the paragraphs relating to divergence from upstream.

This commit puts the comments relating to divergence from upstream back
together.

Signed-off-by: Justin Donnelly &lt;justinrdonnelly@gmail.com&gt;
Reviewed-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>git-prompt: make long upstream state indicator consistent</title>
<updated>2022-03-23T20:07:45Z</updated>
<author>
<name>Justin Donnelly</name>
<email>justinrdonnelly@gmail.com</email>
</author>
<published>2022-02-27T19:57:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=51d2d677909c031969f82c1c5ef1cc261a9990b3'/>
<id>urn:sha1:51d2d677909c031969f82c1c5ef1cc261a9990b3</id>
<content type='text'>
Use a pipe as a separator before long upstream state indicator. This is
consistent with long state indicators for sparse and in-progress
operations (e.g. merge).

For comparison, `__git_ps1` examples without upstream state indicator:
(main)
(main %)
(main *%)
(main|SPARSE)
(main %|SPARSE)
(main *%|SPARSE)
(main|SPARSE|REBASE 1/2)
(main %|SPARSE|REBASE 1/2)

Note that if there are long state indicators, they appear after short
state indicators if there are any, or after the branch name if there are
no short state indicators. Each long state indicator begins with a pipe
(`|`) as a separator.

Before/after examples with long upstream state indicator:
| Before                          | After                           |
| ------------------------------- | ------------------------------- |
| (main u=)                       | (main|u=)                       |
| (main u= origin/main)           | (main|u= origin/main)           |
| (main u+1)                      | (main|u+1)                      |
| (main u+1 origin/main)          | (main|u+1 origin/main)          |
| (main % u=)                     | (main %|u=)                     |
| (main % u= origin/main)         | (main %|u= origin/main)         |
| (main % u+1)                    | (main %|u+1)                    |
| (main % u+1 origin/main)        | (main %|u+1 origin/main)        |
| (main|SPARSE u=)                | (main|SPARSE|u=)                |
| (main|SPARSE u= origin/main)    | (main|SPARSE|u= origin/main)    |
| (main|SPARSE u+1)               | (main|SPARSE|u+1)               |
| (main|SPARSE u+1 origin/main)   | (main|SPARSE|u+1 origin/main)   |
| (main %|SPARSE u=)              | (main %|SPARSE|u=)              |
| (main %|SPARSE u= origin/main)  | (main %|SPARSE|u= origin/main)  |
| (main %|SPARSE u+1)             | (main %|SPARSE|u+1)             |
| (main %|SPARSE u+1 origin/main) | (main %|SPARSE|u+1 origin/main) |

Signed-off-by: Justin Donnelly &lt;justinrdonnelly@gmail.com&gt;
Reviewed-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>git-prompt: make upstream state indicator location consistent</title>
<updated>2022-03-23T20:07:40Z</updated>
<author>
<name>Justin Donnelly</name>
<email>justinrdonnelly@gmail.com</email>
</author>
<published>2022-02-27T19:57:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ec7c23cdc6bde5af3039c59e21507adf7579a99'/>
<id>urn:sha1:0ec7c23cdc6bde5af3039c59e21507adf7579a99</id>
<content type='text'>
Make upstream state indicator location more consistent with similar
state indicators (e.g. sparse). Group the short upstream state indicator
(`=`, `&lt;`, `&gt;`, or `&lt;&gt;`) with other short state indicators immediately
after the branch name. Previously short and long upstream state
indicators appeared after all other state indicators.

Use a separator (`SP` or `GIT_PS1_STATESEPARATOR`) between branch name
and short upstream state indicator. Previously the short upstream state
indicator would sometimes appear directly adjacent to the branch name
instead of being separated.

For comparison, `__git_ps1` examples without upstream state indicator:
(main)
(main %)
(main *%)
(main|SPARSE)
(main %|SPARSE)
(main *%|SPARSE)
(main|SPARSE|REBASE 1/2)
(main %|SPARSE|REBASE 1/2)

Note that if there are short state indicators, they appear together
after the branch name and separated from it by `SP` or
`GIT_PS1_STATESEPARATOR`.

Before/after examples with short upstream state indicator:
| Before           | After            |
| ---------------- | ---------------- |
| (main=)          | (main =)         |
| (main|SPARSE=)   | (main =|SPARSE)  |
| (main %|SPARSE=) | (main %=|SPARSE) |

Signed-off-by: Justin Donnelly &lt;justinrdonnelly@gmail.com&gt;
Reviewed-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>git-prompt: rename `upstream` to `upstream_type`</title>
<updated>2022-03-23T20:07:26Z</updated>
<author>
<name>Justin Donnelly</name>
<email>justinrdonnelly@gmail.com</email>
</author>
<published>2022-02-27T19:57:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d9dc2c57a36027a619c3b846cce5f02206d9a06'/>
<id>urn:sha1:4d9dc2c57a36027a619c3b846cce5f02206d9a06</id>
<content type='text'>
In `__git_ps1_show_upstream` rename the variable `upstream` to
`upstream_type`. This allows `__git_ps1_show_upstream` to reference a
variable named `upstream` that is declared `local` in `__git_ps1`, which
calls `__git_ps1_show_upstream`.

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