<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/graph.c, branch v2.45.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-09-18T16:39:07Z</updated>
<entry>
<title>diff --stat: add config option to limit filename width</title>
<updated>2023-09-18T16:39:07Z</updated>
<author>
<name>Dragan Simic</name>
<email>dsimic@manjaro.org</email>
</author>
<published>2023-09-11T15:39:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd48adc31d0522e7877aa494ce7df91581e09587'/>
<id>urn:sha1:bd48adc31d0522e7877aa494ce7df91581e09587</id>
<content type='text'>
Add new configuration option diff.statNameWidth=&lt;width&gt; that is equivalent
to the command-line option --stat-name-width=&lt;width&gt;, but it is ignored
by format-patch.  This follows the logic established by the already
existing configuration option diff.statGraphWidth=&lt;width&gt;.

Limiting the widths of names and graphs in the --stat output makes sense
for interactive work on wide terminals with many columns, hence the support
for these configuration options.  They don't affect format-patch because
it already adheres to the traditional 80-column standard.

Update the documentation and add more tests to cover new configuration
option diff.statNameWidth=&lt;width&gt;.  While there, perform a few minor code
and whitespace cleanups here and there, as spotted.

Signed-off-by: Dragan Simic &lt;dsimic@manjaro.org&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>log: fix memory leak if --graph is passed multiple times</title>
<updated>2022-02-11T18:06:40Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2022-02-11T16:36:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dccf6c16f1cee485f05ef42ba67a9309c358a78d'/>
<id>urn:sha1:dccf6c16f1cee485f05ef42ba67a9309c358a78d</id>
<content type='text'>
Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>graph: improve grammar of "invalid color" error message</title>
<updated>2021-06-15T03:54:26Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2021-06-12T18:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98538307876ab9565c24d45bce6b5302f99fec0b'/>
<id>urn:sha1:98538307876ab9565c24d45bce6b5302f99fec0b</id>
<content type='text'>
Without the "d", it sounds like a command, not an error, and is liable
to be translated incorrectly.

Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strvec: rename struct fields</title>
<updated>2020-07-31T02:18:06Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-29T00:37:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d70a9eb611a9d242c1d26847d223b8677609305b'/>
<id>urn:sha1:d70a9eb611a9d242c1d26847d223b8677609305b</id>
<content type='text'>
The "argc" and "argv" names made sense when the struct was argv_array,
but now they're just confusing. Let's rename them to "nr" (which we use
for counts elsewhere) and "v" (which is rather terse, but reads well
when combined with typical variable names like "args.v").

Note that we have to update all of the callers immediately. Playing
tricks with the preprocessor is hard here, because we wouldn't want to
rewrite unrelated tokens.

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>strvec: convert more callers away from argv_array name</title>
<updated>2020-07-28T22:02:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:24:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef8d7ac42a6a62d678166fe25ea743315809d2bb'/>
<id>urn:sha1:ef8d7ac42a6a62d678166fe25ea743315809d2bb</id>
<content type='text'>
We eventually want to drop the argv_array name and just use strvec
consistently. There's no particular reason we have to do it all at once,
or care about interactions between converted and unconverted bits.
Because of our preprocessor compat layer, the names are interchangeable
to the compiler (so even a definition and declaration using different
names is OK).

This patch converts remaining files from the first half of the alphabet,
to keep the diff to a manageable size.

The conversion was done purely mechanically with:

  git ls-files '*.c' '*.h' |
  xargs perl -i -pe '
    s/ARGV_ARRAY/STRVEC/g;
    s/argv_array/strvec/g;
  '

and then selectively staging files with "git add '[abcdefghjkl]*'".
We'll deal with any indentation/style fallouts 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>strvec: rename files from argv-array to strvec</title>
<updated>2020-07-28T22:02:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98'/>
<id>urn:sha1:dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98</id>
<content type='text'>
This requires updating #include lines across the code-base, but that's
all fairly mechanical, and was done with:

  git ls-files '*.c' '*.h' |
  xargs perl -i -pe 's/argv-array.h/strvec.h/'

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>graph.c: limit linkage of internal variable</title>
<updated>2020-04-27T18:21:25Z</updated>
<author>
<name>Đoàn Trần Công Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2020-04-27T14:22:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9d2152d3db9aec03cb8ef055c6fdd065eabeb8dd'/>
<id>urn:sha1:9d2152d3db9aec03cb8ef055c6fdd065eabeb8dd</id>
<content type='text'>
Signed-off-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Reviewed-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>graph: fix collapse of multiple edges</title>
<updated>2020-01-15T20:14:51Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2020-01-08T04:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c958d3bd0a3781094db6fa8c45776785c98b6c98'/>
<id>urn:sha1:c958d3bd0a3781094db6fa8c45776785c98b6c98</id>
<content type='text'>
This fix resolves the previously-added test_expect_failure in
t4215-log-skewed-merges.sh.

The issue lies in the "else" condition while updating the mapping
inside graph_output_collapsing_line(). In 0f0f389f (graph: tidy up
display of left-skewed merges, 2019-10-15), the output of left-
skewed merges was changed to allow an immediate horizontal edge in
the first parent, output by graph_output_post_merge_line() instead
of by graph_output_collapsing_line(). This condensed the first line
behavior as follows:

Before 0f0f389f:

	| | | | | | *-.
	| | | | | | |\ \
	| |_|_|_|_|/ | |
	|/| | | | | / /

After 0f0f389f:

	| | | | | | *
	| |_|_|_|_|/|\
	|/| | | | |/ /
	| | | | |/| /

However, a very subtle issue arose when the second and third parent
edges are collapsed in later steps. The second parent edge is now
immediately adjacent to a vertical edge. This means that the
condition

	} else if (graph-&gt;mapping[i - 1] &lt; 0) {

in graph_output_collapsing_line() evaluates as false. The block for
this condition was the only place where we connected the target
column with the current position with horizontal edge markers.

In this case, the final "else" block is run, and the edge is marked
as horizontal, but did not back-fill the blank columns between the
target and the current edge. Since the second parent edge is marked
as horizontal, the third parent edge is not marked as horizontal.
This causes the output to continue as follows:

Before this change:

	| | | | | | *
	| |_|_|_|_|/|\
	|/| | | | |/ /
	| | | | |/| /
	| | | |/| |/
	| | |/| |/|
	| |/| |/| |
	| | |/| | |

By adding the logic for "filling" a horizontal edge between the
target column and the current column, we are able to resolve the
issue.

After this change:

	| | | | | | *
	| |_|_|_|_|/|\
	|/| | | | |/ /
	| | |_|_|/| /
	| |/| | | |/
	| | | |_|/|
	| | |/| | |

This output properly matches the expected blend of the edge
behavior before 0f0f389f and the merge commit rendering from
0f0f389f.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>graph: fix lack of color in horizontal lines</title>
<updated>2020-01-08T17:37:18Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2020-01-07T21:27:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a1087c93677bc0304c98f14915b1843e470e4a55'/>
<id>urn:sha1:a1087c93677bc0304c98f14915b1843e470e4a55</id>
<content type='text'>
In some cases, horizontal lines in rendered graphs can lose their
coloring. This is due to a use of graph_line_addch() instead of
graph_line_write_column(). Using a ternary operator to pick the
character is nice for compact code, but we actually need a column to
provide the color.

Add a test to t4215-log-skewed-merges.sh to prevent regression.

Reported-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
