<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/diff-files.c, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-02-26T00:43:30Z</updated>
<entry>
<title>Merge branch 'jc/diffcore-rotate'</title>
<updated>2021-02-26T00:43:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-26T00:43:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=845d6030f81da3bb43bd24a78ef8c441a441c5d5'/>
<id>urn:sha1:845d6030f81da3bb43bd24a78ef8c441a441c5d5</id>
<content type='text'>
"git {diff,log} --{skip,rotate}-to=&lt;path&gt;" allows the user to
discard diff output for early paths or move them to the end of the
output.

* jc/diffcore-rotate:
  diff: --{rotate,skip}-to=&lt;path&gt;
</content>
</entry>
<entry>
<title>diff: --{rotate,skip}-to=&lt;path&gt;</title>
<updated>2021-02-16T17:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-11T19:57:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1eb4136ac2a24764257567b930535fcece01719f'/>
<id>urn:sha1:1eb4136ac2a24764257567b930535fcece01719f</id>
<content type='text'>
In the implementation of "git difftool", there is a case where the
user wants to start viewing the diffs at a specific path and
continue on to the rest, optionally wrapping around to the
beginning.  Since it is somewhat cumbersome to implement such a
feature as a post-processing step of "git diff" output, let's
support it internally with two new options.

 - "git diff --rotate-to=C", when the resulting patch would show
   paths A B C D E without the option, would "rotate" the paths to
   shows patch to C D E A B instead.  It is an error when there is
   no patch for C is shown.

 - "git diff --skip-to=C" would instead "skip" the paths before C,
   and shows patch to C D E.  Again, it is an error when there is no
   patch for C is shown.

 - "git log [-p]" also accepts these two options, but it is not an
   error if there is no change to the specified path.  Instead, the
   set of output paths are rotated or skipped to the specified path
   or the first path that sorts after the specified path.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/precompose-prefix-too'</title>
<updated>2021-02-12T22:21:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-12T22:21:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8b25dee6155fd3816f62649da196a4f42cf5584e'/>
<id>urn:sha1:8b25dee6155fd3816f62649da196a4f42cf5584e</id>
<content type='text'>
When commands are started from a subdirectory, they may have to
compare the path to the subdirectory (called prefix and found out
from $(pwd)) with the tracked paths.  On macOS, $(pwd) and
readdir() yield decomposed path, while the tracked paths are
usually normalized to the precomposed form, causing mismatch.  This
has been fixed by taking the same approach used to normalize the
command line arguments.

* tb/precompose-prefix-too:
  MacOS: precompose_argv_prefix()
</content>
</entry>
<entry>
<title>MacOS: precompose_argv_prefix()</title>
<updated>2021-02-03T22:09:37Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2021-02-03T16:28:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c327502dbf7a27c8784c20037851206a87857c1'/>
<id>urn:sha1:5c327502dbf7a27c8784c20037851206a87857c1</id>
<content type='text'>
The following sequence leads to a "BUG" assertion running under MacOS:

  DIR=git-test-restore-p
  Adiarnfd=$(printf 'A\314\210')
  DIRNAME=xx${Adiarnfd}yy
  mkdir $DIR &amp;&amp;
  cd $DIR &amp;&amp;
  git init &amp;&amp;
  mkdir $DIRNAME &amp;&amp;
  cd $DIRNAME &amp;&amp;
  echo "Initial" &gt;file &amp;&amp;
  git add file &amp;&amp;
  echo "One more line" &gt;&gt;file &amp;&amp;
  echo y | git restore -p .

 Initialized empty Git repository in /tmp/git-test-restore-p/.git/
 BUG: pathspec.c:495: error initializing pathspec_item
 Cannot close git diff-index --cached --numstat
 [snip]

The command `git restore` is run from a directory inside a Git repo.
Git needs to split the $CWD into 2 parts:
The path to the repo and "the rest", if any.
"The rest" becomes a "prefix" later used inside the pathspec code.

As an example, "/path/to/repo/dir-inside-repå" would determine
"/path/to/repo" as the root of the repo, the place where the
configuration file .git/config is found.

The rest becomes the prefix ("dir-inside-repå"), from where the
pathspec machinery expands the ".", more about this later.
If there is a decomposed form, (making the decomposing visible like this),
"dir-inside-rep°a" doesn't match "dir-inside-repå".

Git commands need to:

 (a) read the configuration variable "core.precomposeunicode"
 (b) precocompose argv[]
 (c) precompose the prefix, if there was any

The first commit,
76759c7dff53 "git on Mac OS and precomposed unicode"
addressed (a) and (b).

The call to precompose_argv() was added into parse-options.c,
because that seemed to be a good place when the patch was written.

Commands that don't use parse-options need to do (a) and (b) themselfs.

The commands `diff-files`, `diff-index`, `diff-tree` and `diff`
learned (a) and (b) in
commit 90a78b83e0b8 "diff: run arguments through precompose_argv"

Branch names (or refs in general) using decomposed code points
resulting in decomposed file names had been fixed in
commit 8e712ef6fc97 "Honor core.precomposeUnicode in more places"

The bug report from above shows 2 things:
- more commands need to handle precomposed unicode
- (c) should be implemented for all commands using pathspecs

Solution:
precompose_argv() now handles the prefix (if needed), and is renamed into
precompose_argv_prefix().

Inside this function the config variable core.precomposeunicode is read
into the global variable precomposed_unicode, as before.
This reading is skipped if precomposed_unicode had been read before.

The original patch for preocomposed unicode, 76759c7dff53, placed
precompose_argv() into parse-options.c

Now add it into git.c::run_builtin() as well.  Existing precompose
calls in diff-files.c and others may become redundant, and if we
audit the callflows that reach these places to make sure that they
can never be reached without going through the new call added to
run_builtin(), we might be able to remove these existing ones.

But in this commit, we do not bother to do so and leave these
precompose callsites as they are.  Because precompose() is
idempotent and can be called on an already precomposed string
safely, this is safer than removing existing calls without fully
vetting the callflows.

There is certainly room for cleanups - this change intends to be a bug fix.
Cleanups needs more tests in e.g. t/t3910-mac-os-precompose.sh, and should
be done in future commits.

[1] git-bugreport-2021-01-06-1209.txt (git can't deal with special characters)
[2] https://lore.kernel.org/git/A102844A-9501-4A86-854D-E3B387D378AA@icloud.com/

Reported-by: Daniel Troger &lt;random_n0body@icloud.com&gt;
Helped-By: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-merges: new function diff_merges_set_dense_combined_if_unset()</title>
<updated>2020-12-21T21:47:31Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b6c17b5c0bd126e3c712f5de909a033d99f1e3a'/>
<id>urn:sha1:3b6c17b5c0bd126e3c712f5de909a033d99f1e3a</id>
<content type='text'>
Call it where given functionality is needed instead of direct
checking/tweaking of diff merges related fields.

Signed-off-by: Sergey Organov &lt;sorganov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-files: treat "i-t-a" files as "not-in-index"</title>
<updated>2020-06-22T17:46:45Z</updated>
<author>
<name>Srinidhi Kaushik</name>
<email>shrinidhi.kaushik@gmail.com</email>
</author>
<published>2020-06-20T16:38:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=feea6946a5b746ff4ebf8ccdf959e303203a6011'/>
<id>urn:sha1:feea6946a5b746ff4ebf8ccdf959e303203a6011</id>
<content type='text'>
The `diff-files' command and related commands which call the function
`cmd_diff_files()', consider the "intent-to-add" files as a part of the
index when comparing the work-tree against it. This was previously
addressed in commits [1] and [2] by turning the option
`--ita-invisible-in-index' (introduced in [3]) on by default.

For `diff-files' (and `add -p' as a consequence) to show the i-t-a
files as as new, `ita_invisible_in_index' will be enabled by default
here as well.

[1] 0231ae71d3 (diff: turn --ita-invisible-in-index on by default,
                2018-05-26)
[2] 425a28e0a4 (diff-lib: allow ita entries treated as "not yet exist
                in index", 2016-10-24)
[3] b42b451919 (diff: add --ita-[in]visible-in-index, 2016-10-24)

Signed-off-by: Srinidhi Kaushik &lt;shrinidhi.kaushik@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch</title>
<updated>2019-01-24T19:55:06Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-24T08:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8adbec9feaa7a1ab9814db1115826e87033712e'/>
<id>urn:sha1:f8adbec9feaa7a1ab9814db1115826e87033712e</id>
<content type='text'>
By default, index compat macros are off from now on, because they
could hide the_index dependency.

Only those in builtin can use it.

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>revision.c: remove implicit dependency on the_index</title>
<updated>2018-09-21T16:51:19Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-09-21T15:57:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2abf3503854e27e18b2fb5ba97ceeb3f79240ee5'/>
<id>urn:sha1:2abf3503854e27e18b2fb5ba97ceeb3f79240ee5</id>
<content type='text'>
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>submodule: remove gitmodules_config</title>
<updated>2017-08-03T20:11:02Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-08-03T18:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=557a5998df19faf8641acfc5b6b1c3c2ba64dca9'/>
<id>urn:sha1:557a5998df19faf8641acfc5b6b1c3c2ba64dca9</id>
<content type='text'>
Now that the submodule-config subsystem can lazily read the gitmodules
file we no longer need to explicitly pre-read the gitmodules by calling
'gitmodules_config()' so let's remove it.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bw/config-h'</title>
<updated>2017-06-24T21:28:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-24T21:28:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f31d23a399d557d687266b4375a0436f920cc051'/>
<id>urn:sha1:f31d23a399d557d687266b4375a0436f920cc051</id>
<content type='text'>
Fix configuration codepath to pay proper attention to commondir
that is used in multi-worktree situation, and isolate config API
into its own header file.

* bw/config-h:
  config: don't implicitly use gitdir or commondir
  config: respect commondir
  setup: teach discover_git_directory to respect the commondir
  config: don't include config.h by default
  config: remove git_config_iter
  config: create config.h
</content>
</entry>
</feed>
