<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/git-add--interactive.perl, branch v1.5.6.4</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.5.6.4</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.5.6.4'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2008-03-27T20:54:57Z</updated>
<entry>
<title>add--interactive: allow user to choose mode update</title>
<updated>2008-03-27T20:54:57Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-03-27T07:32:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ca7246864b43e9ea1922cc5386225ecd1b3bdd98'/>
<id>urn:sha1:ca7246864b43e9ea1922cc5386225ecd1b3bdd98</id>
<content type='text'>
When using the 'p'atch command, instead of just throwing out any mode
change, present it to the user in the same way that we show hunks.

This way, the mode change can be staged independently from the changes
to the contents.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: ignore mode change in 'p'atch command</title>
<updated>2008-03-27T20:54:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-03-27T07:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b717a627629e6886956af54274d507b9711d49e6'/>
<id>urn:sha1:b717a627629e6886956af54274d507b9711d49e6</id>
<content type='text'>
When a path is examined in the patch subcommand, any mode changes in
the file are given to use in the diff header by git-diff. If no hunks
are staged, then we throw out that header and do not touch the
path.  But if _any_ hunks are staged, we use the header, and the mode
is changed together with the contents.

Since the 'p'atch command should just be dealing with hunks that are
shown to the user, it makes sense to just ignore mode changes
entirely. We do squirrel away the mode, though, since the next patch
will allow users to select the mode update separately.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: handle initial commit better</title>
<updated>2008-02-16T09:02:44Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-02-13T10:50:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=18bc76164dbf4f6d54b8fa9c9c29db9ca66c7877'/>
<id>urn:sha1:18bc76164dbf4f6d54b8fa9c9c29db9ca66c7877</id>
<content type='text'>
There were several points where we looked at the HEAD
commit; for initial commits, this is meaningless. So instead
we:

  - show staged status data as a diff against the empty tree
    instead of HEAD
  - show file diffs as creation events
  - use "git rm --cached" to revert instead of going back to
    the HEAD commit

We magically reference the empty tree to implement this.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: allow diff colors without interactive colors</title>
<updated>2008-01-07T02:41:44Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-01-04T08:35:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f87e310d2c53f412cf9ba0a04e06c974c17b9062'/>
<id>urn:sha1:f87e310d2c53f412cf9ba0a04e06c974c17b9062</id>
<content type='text'>
Users with color.diff set to true/auto will not see color in
"git add -i" unless they also set color.interactive.

This changes the semantics of color.interactive to control only the
coloring of the interaction aspect of the command and let color.diff
to control the color of hunk picker, which would arguably be more
convenient.

Old $use_color variable is now renamed to $menu_use_color to make it
clear that it is about coloring the interaction.

The "colored" subroutine now checks if the passed color is defined,
instead of checking $use_color variable, to decide if the lines should
be colored.  The various variables that define colors for different
parts of the output are set or unset depending on the setting of
color.interactive and color.diff configuration variables.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: remove unused diff colors</title>
<updated>2008-01-07T02:41:44Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-01-06T04:24:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=50e3d1eeffefc8af58dbcf2ec79978ea375392b4'/>
<id>urn:sha1:50e3d1eeffefc8af58dbcf2ec79978ea375392b4</id>
<content type='text'>
When color support was added, we colored the diffs ourselves.
However, 4af756f3 changed this to simply run "git diff-files"
twice, keeping the colored output separately.

This makes the internal diff color variables obsolete with
one exception: when splitting hunks, we have to manually
recreate the fragment for each part of the split. Thus we
keep $fraginfo_color around to do that correctly.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Teach "git add -i" to colorize whitespace errors</title>
<updated>2007-12-08T10:53:19Z</updated>
<author>
<name>Wincent Colaiuta</name>
<email>win@wincent.com</email>
</author>
<published>2007-12-07T12:35:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=4af756f31b0696ed1ca6ad10dc6d7053477edc16'/>
<id>urn:sha1:4af756f31b0696ed1ca6ad10dc6d7053477edc16</id>
<content type='text'>
Rather than replicating the colorization logic of "git diff-files" we
rely on "git diff-files" itself. This guarantees consistent colorization
in and outside "git add -i".

Seeing as speed is not a concern here (the bottleneck is how fast the
user can read, not how fast "git diff-files" runs) we do this by
actually running it twice, once without color and once with.

In this way as the whitespace colorization provided by "git diff-files"
evolves (per-path attributes, new classes of whitespace error), "git
add -i" will automatically benefit from it and stay in synch.

Also, by working with two sets of diff output (an uncolorized one for
internal processing and a colorized one for display only) we minimize
the risk of regressions because the changes required to implement this
are minimally invasive.

Signed-off-by: Wincent Colaiuta &lt;win@wincent.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Color support for "git-add -i"</title>
<updated>2007-12-06T01:57:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-12-05T08:50:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b4c61ed6d35ea00494f953a27abbc902617972ec'/>
<id>urn:sha1:b4c61ed6d35ea00494f953a27abbc902617972ec</id>
<content type='text'>
This is mostly lifted from earlier series by Dan Zwell, but updated to
use "git config --get-color" and "git config --get-colorbool" to make it
simpler and more consistent with commands written in C.

A new configuration color.interactive variable is like color.diff and
color.status, and controls if "git-add -i" uses color.

A set of configuration variables, color.interactive.&lt;slot&gt;, are used to
define what color is used for the prompt, header, and help text.

For perl scripts, Git.pm provides $repo-&gt;get_color() method, which takes
the slot name and the default color, and returns the terminal escape
sequence to color the output text.  $repo-&gt;get_colorbool() method can be
used to check if color is set to be used for a given operation.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-add -i: add help text for list-and-choose UI</title>
<updated>2007-12-03T09:04:28Z</updated>
<author>
<name>Wincent Colaiuta</name>
<email>win@wincent.com</email>
</author>
<published>2007-12-03T08:09:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7e018be2ada073c92da59eb41442cde22c0c2796'/>
<id>urn:sha1:7e018be2ada073c92da59eb41442cde22c0c2796</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add -i: allow prefix highlighting for "Add untracked" as well.</title>
<updated>2007-12-02T19:09:22Z</updated>
<author>
<name>Wincent Colaiuta</name>
<email>win@wincent.com</email>
</author>
<published>2007-12-02T13:44:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=633209898b71df4cf4d9296f224294f9fe252f66'/>
<id>urn:sha1:633209898b71df4cf4d9296f224294f9fe252f66</id>
<content type='text'>
These changes make the automatic prefix highlighting work with the "Add
untracked" subcommand in git-add--interactive by explicitly handling
arrays, hashes and strings internally (previously only arrays and hashes
were handled).

In addition, prefixes which have special meaning for list_and_choose
(things like "*" for "all" and "-" for "deselect) are explicitly
excluded (highlighting these prefixes would be misleading).

Signed-off-by: Wincent Colaiuta &lt;win@wincent.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Highlight keyboard shortcuts in git-add--interactive</title>
<updated>2007-11-30T20:37:40Z</updated>
<author>
<name>Wincent Colaiuta</name>
<email>win@wincent.com</email>
</author>
<published>2007-11-29T12:00:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=14cb50382c9027ca3b8cf8dbc0a26503a40f50c5'/>
<id>urn:sha1:14cb50382c9027ca3b8cf8dbc0a26503a40f50c5</id>
<content type='text'>
The user interface provided by the command loop in git-add--interactive
gives the impression that subcommands can only be launched by entering
an integer identifier from 1 through 8.

A "hidden" feature is that any string can be entered, and a regex search
anchored at the beginning of the string is used to find the uniquely
matching option.

This patch makes this feature a little more obvious by highlighting the
first character of each subcommand (for example "patch" is displayed as
"[p]atch").

A new function is added to detect the shortest unique prefix and this
is used to decide what to highlight. Highlighting is also applied when
choosing files.

In the case where the common prefix may be unreasonably large
highlighting is omitted; in this patch the soft limit (above which the
highlighting will be omitted for a particular item) is 0 (in other words,
there is no soft limit) and the hard limit (above which highlighting will
be omitted for all items) is 3, but this can be tweaked.

The actual highlighting is done by the highlight_prefix function, which
will enable us to implement ANSI color code-based highlighting (most
likely using underline or boldface) in the future.

Signed-off-by: Wincent Colaiuta &lt;win@wincent.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
