<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t4013, branch v2.26.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-05-30T17:50:44Z</updated>
<entry>
<title>Merge branch 'nd/diff-parseopt'</title>
<updated>2019-05-30T17:50:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-05-30T17:50:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=20aa7c594fbc2e36476daae2f53d7c020306c62c'/>
<id>urn:sha1:20aa7c594fbc2e36476daae2f53d7c020306c62c</id>
<content type='text'>
A brown-paper-bag bugfix to a change already in 'master'.

* nd/diff-parseopt:
  parse-options: check empty value in OPT_INTEGER and OPT_ABBREV
  diff-parseopt: restore -U (no argument) behavior
  diff-parseopt: correct variable types that are used by parseopt
</content>
</entry>
<entry>
<title>diff-parseopt: restore -U (no argument) behavior</title>
<updated>2019-05-29T18:04:32Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-05-29T09:11:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ef05193bcdda6a28cd41fa3ecd8f356061d49e0'/>
<id>urn:sha1:8ef05193bcdda6a28cd41fa3ecd8f356061d49e0</id>
<content type='text'>
Before d473e2e0e8 (diff.c: convert -U|--unified, 2019-01-27), -U and
--unified are implemented with a custom parser opt_arg() in diff.c. I
didn't check this code carefully and not realize that it's the
equivalent of PARSE_OPT_NONEG | PARSE_OPT_OPTARG.

In other words, if -U is specified without any argument, the option
should be accepted, and the default value should be used. Without
PARSE_OPT_OPTARG, parse_options() will reject this case and cause a
regression.

Reported-by: Bryan Turner &lt;bturner@atlassian.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>combine-diff: treat --dirstat like --stat</title>
<updated>2019-01-24T20:18:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-01-24T12:36:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dac03b5518a053e52ed7ee20925970728d3ae4c3'/>
<id>urn:sha1:dac03b5518a053e52ed7ee20925970728d3ae4c3</id>
<content type='text'>
Currently "--cc --dirstat" will show nothing for a merge.  Like
--shortstat and --summary in the previous two patches, it probably makes
sense to treat it like we do --stat, and show a stat against the
first-parent.

This case is less obviously correct than for --shortstat and --summary,
as those are basically variants of --stat themselves. It's possible we
could develop a multi-parent combined dirstat format, in which case we
might regret defining this first-parent behavior. But the same could be
said for --stat, and in the 12+ years of it showing first-parent stats,
nobody has complained.

So showing the first-parent dirstat is at least _useful_, and if we
later develop a clever multi-parent stat format, we'd probably have to
deal with --stat anyway.

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>combine-diff: treat --summary like --stat</title>
<updated>2019-01-24T20:18:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-01-24T12:35:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=04b19fcafd734245e61fd1c090cd7de8c2993eaa'/>
<id>urn:sha1:04b19fcafd734245e61fd1c090cd7de8c2993eaa</id>
<content type='text'>
Currently "--cc --summary" on a merge shows nothing. Since we show "--cc
--stat" as a stat against the first parent, and because --summary is
typically used in combination with --stat, it makes sense to treat them
both the same way.

Note that we have to tweak t4013's setup a bit to test this case, as the
existing merges do not have any --summary results against their first
parent. But since the merge at the tip of 'master' does add and remove
files with respect to the second parent, we can just make a reversed
doppelganger merge where the parents are swapped.

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>combine-diff: treat --shortstat like --stat</title>
<updated>2019-01-24T20:18:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-01-24T12:34:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8290faa077784a2518d0a77b448ca2987c3baf07'/>
<id>urn:sha1:8290faa077784a2518d0a77b448ca2987c3baf07</id>
<content type='text'>
The --stat of a combined diff is defined as the first-parent stat,
going all the way back to 965f803c32 (combine-diff: show diffstat with
the first parent., 2006-04-17).

Naturally, we gave --numstat the same treatment in 74e2abe5b7 (diff
--numstat, 2006-10-12).

But --shortstat, which is really just the final line of --stat, does
nothing, which produces confusing results:

  $ git show --oneline --stat eab7584e37
  eab7584e37 Merge branch 'en/show-ref-doc-fix'

   Documentation/git-show-ref.txt | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

  $ git show --oneline --shortstat eab7584e37
  eab7584e37 Merge branch 'en/show-ref-doc-fix'

  [nothing! We'd expect to see the "1 file changed..." line]

This patch teaches combine-diff to treats the two formats identically.

Reported-by: David Turner &lt;novalis@novalis.org&gt;
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>diff: add --compact-summary</title>
<updated>2018-02-27T23:22:47Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-24T14:09:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ddf88fa6166473be15822739e0a12aad4edfbbc5'/>
<id>urn:sha1:ddf88fa6166473be15822739e0a12aad4edfbbc5</id>
<content type='text'>
Certain information is currently shown with --summary, but when used
in combination with --stat it's a bit hard to read since info of the
same file is in two places (--stat and --summary).

On top of that, commits that add or remove files double the number of
display lines, which could be a lot if you add or remove a lot of
files.

--compact-summary embeds most of --summary back in --stat in the
little space between the file name part and the graph line, e.g. with
commit 0433d533f1:

   Documentation/merge-config.txt         |  4 +
   builtin/merge.c                        |  2 +
   ...-pull-verify-signatures.sh (new +x) | 81 ++++++++++++++
   t/t7612-merge-verify-signatures.sh     | 45 ++++++++
   4 files changed, 132 insertions(+)

It helps both condensing information and saving some text
space. What's new in diffstat is:

- A new 0644 file is shown as (new)
- A new 0755 file is shown as (new +x)
- A new symlink is shown as (new +l)
- A deleted file is shown as (gone)
- A mode change adding executable bit is shown as (mode +x)
- A mode change removing it is shown as (mode -x)

Note that --compact-summary does not contain all the information
--summary provides. Rewrite percentage is not shown but it could be
added later, like R50% or C20%.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t4013: test new output from diff --abbrev --raw</title>
<updated>2017-12-06T15:32:59Z</updated>
<author>
<name>Ann T Ropea</name>
<email>bedhanger@gmx.de</email>
</author>
<published>2017-12-03T21:27:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c2f1d39897535cfc0a6427aa2d5cb32043749397'/>
<id>urn:sha1:c2f1d39897535cfc0a6427aa2d5cb32043749397</id>
<content type='text'>
Use newly-introduced finely-grained control to teach the diff-family to
honor the new environment GIT_PRINT_SHA1_ELLIPSIS and remove the
ellipses when it is not set.

Mentored-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Ann T Ropea &lt;bedhanger@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: correct newline in summary for renamed files</title>
<updated>2017-09-28T04:15:59Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-09-27T22:51:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=58aaced4442a6daae1c82318f3f9259001714505'/>
<id>urn:sha1:58aaced4442a6daae1c82318f3f9259001714505</id>
<content type='text'>
In 146fdb0dfe (diff.c: emit_diff_symbol learns about DIFF_SYMBOL_SUMMARY,
2017-06-29), the conversion from direct printing to the symbol emission
dropped the new line character for renamed, copied and rewritten files.

Add the emission of a newline, add a test for this case.

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: handle --no-abbrev in no-index case</title>
<updated>2016-12-08T22:40:30Z</updated>
<author>
<name>Jack Bates</name>
<email>bk874k@nottheoilrig.com</email>
</author>
<published>2016-12-06T16:56:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=43d1948b7b84abc744227259dd1a3e8dfbb60358'/>
<id>urn:sha1:43d1948b7b84abc744227259dd1a3e8dfbb60358</id>
<content type='text'>
There are two different places where the --no-abbrev option is parsed,
and two different places where SHA-1s are abbreviated. We normally parse
--no-abbrev with setup_revisions(), but in the no-index case, "git diff"
calls diff_opt_parse() directly, and diff_opt_parse() didn't handle
--no-abbrev until now. (It did handle --abbrev, however.) We normally
abbreviate SHA-1s with find_unique_abbrev(), but commit 4f03666 ("diff:
handle sha1 abbreviations outside of repository, 2016-10-20) recently
introduced a special case when you run "git diff" outside of a
repository.

setup_revisions() does also call diff_opt_parse(), but not for --abbrev
or --no-abbrev, which it handles itself. setup_revisions() sets
rev_info-&gt;abbrev, and later copies that to diff_options-&gt;abbrev. It
handles --no-abbrev by setting abbrev to zero. (This change doesn't
touch that.)

Setting abbrev to zero was broken in the outside-of-a-repository special
case, which until now resulted in a truly zero-length SHA-1, rather than
taking zero to mean do not abbreviate. The only way to trigger this bug,
however, was by running "git diff --raw" without either the --abbrev or
--no-abbrev options, because 1) without --raw it doesn't respect abbrev
(which is bizarre, but has been that way forever), 2) we silently clamp
--abbrev=0 to MINIMUM_ABBREV, and 3) --no-abbrev wasn't handled until
now.

The outside-of-a-repository case is one of three no-index cases. The
other two are when one of the files you're comparing is outside of the
repository you're in, and the --no-index option.

Signed-off-by: Jack Bates &lt;jack@nottheoilrig.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>graph: add support for --line-prefix on all graph-aware output</title>
<updated>2016-09-01T01:07:09Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.keller@gmail.com</email>
</author>
<published>2016-08-31T23:27:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=660e113ce11840f4bc4028bff89889e6122fe89a'/>
<id>urn:sha1:660e113ce11840f4bc4028bff89889e6122fe89a</id>
<content type='text'>
Add an extension to git-diff and git-log (and any other graph-aware
displayable output) such that "--line-prefix=&lt;string&gt;" will print the
additional line-prefix on every line of output.

To make this work, we have to fix a few bugs in the graph API that force
graph_show_commit_msg to be used only when you have a valid graph.
Additionally, we extend the default_diff_output_prefix handler to work
even when no graph is enabled.

This is somewhat of a hack on top of the graph API, but I think it
should be acceptable here.

This will be used by a future extension of submodule display which
displays the submodule diff as the actual diff between the pre and post
commit in the submodule project.

Add some tests for both git-log and git-diff to ensure that the prefix
is honored correctly.

Signed-off-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
