<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/gitattributes.txt, branch v2.48.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.48.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.48.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-07-08T21:53:08Z</updated>
<entry>
<title>Merge branch 'ss/doc-eol-attr-fix'</title>
<updated>2024-07-08T21:53:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-07-08T21:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2fa5ae30da000322d913081646ff2e3ac79422d3'/>
<id>urn:sha1:2fa5ae30da000322d913081646ff2e3ac79422d3</id>
<content type='text'>
Doc update.

* ss/doc-eol-attr-fix:
  doc: fix case error of eol attribute in example
</content>
</entry>
<entry>
<title>doc: fix case error of eol attribute in example</title>
<updated>2024-06-25T04:49:03Z</updated>
<author>
<name>Shane Sun</name>
<email>github@waterlemons2k.com</email>
</author>
<published>2024-06-23T21:40:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=00f3661a0ad0834e0ba36e650d27dc8787e7acc0'/>
<id>urn:sha1:00f3661a0ad0834e0ba36e650d27dc8787e7acc0</id>
<content type='text'>
The eol attribute only accepts "crlf" and "lf",
but the example incorrectly capitalizes "crlf".

References:

- https://git-scm.com/docs/gitattributes#_eol
- https://github.com/git/git/blob/v2.45.2/convert.c#L1278

Signed-off-by: Shane Sun &lt;github@waterlemons2k.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: let external diffs report that changes are uninteresting</title>
<updated>2024-06-10T16:20:46Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-06-09T07:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7b97b7185521e3b9364b3abc6553df2480da173'/>
<id>urn:sha1:d7b97b7185521e3b9364b3abc6553df2480da173</id>
<content type='text'>
The options --exit-code and --quiet instruct git diff to indicate
whether it found any significant changes by exiting with code 1 if it
did and 0 if there were none.  Currently this doesn't work if external
diff programs are involved, as we have no way to learn what they found.

Add that ability in the form of the new configuration options
diff.trustExitCode and diff.&lt;driver&gt;.trustExitCode and the environment
variable GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE.  They pair with the config
options diff.external and diff.&lt;driver&gt;.command and the environment
variable GIT_EXTERNAL_DIFF, respectively.

The new options are off by default, keeping the old behavior.  Enabling
them indicates that the external diff returns exit code 1 if it finds
significant changes and 0 if it doesn't, like diff(1).

The name of the new options is taken from the git difftool and mergetool
options of similar purpose.  (There they enable passing on the exit code
of a diff tool and to infer whether a merge done by a merge tool is
successful.)

The new feature sets the diff flag diff_from_contents in
diff_setup_done() if we need the exit code and are allowed to call
external diffs.  This disables the optimization that avoids calling the
program with --quiet.  Add it back by skipping the call if the external
diff is not able to report empty diffs.  We can only do that check after
evaluating the file-specific attributes in run_external_diff().

If we do run the external diff with --quiet, send its output to
/dev/null.

I considered checking the output of the external diff to check whether
its empty.  It was added as 11be65cfa4 (diff: fix --exit-code with
external diff, 2024-05-05) and quickly reverted, as it does not work
with external diffs that do not write to stdout.  There's no reason why
a graphical diff tool would even need to write anything there at all.

I also considered using a non-zero exit code for empty diffs, which
could be done without adding new configuration options.  We'd need to
disable the optimization that allows git diff --quiet to skip calling
external diffs, though -- that might be quite surprising if graphical
diff programs are involved.  And assigning the opposite meaning of the
exit codes compared to diff(1) and git diff --exit-code to the external
diff can cause unnecessary confusion.

Suggested-by: Phillip Wood &lt;phillip.wood123@gmail.com&gt;
Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge-ll: expose revision names to custom drivers</title>
<updated>2024-01-24T21:15:06Z</updated>
<author>
<name>Antonin Delpeuch</name>
<email>antonin@delpeuch.eu</email>
</author>
<published>2024-01-24T20:09:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=81effe94682dbfed55171468074db85fa661cc21'/>
<id>urn:sha1:81effe94682dbfed55171468074db85fa661cc21</id>
<content type='text'>
Custom merge drivers need access to the names of the revisions they
are working on, so that the merge conflict markers they introduce
can refer to those revisions. The placeholders '%S', '%X' and '%Y'
are introduced to this end.

Signed-off-by: Antonin Delpeuch &lt;antonin@delpeuch.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: add builtin objectmode values support</title>
<updated>2023-12-28T21:21:52Z</updated>
<author>
<name>Joanna Wang</name>
<email>jojwang@google.com</email>
</author>
<published>2023-11-16T05:44:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2232a88ab6bfbe41faf73f85912937e20bf8b4ee'/>
<id>urn:sha1:2232a88ab6bfbe41faf73f85912937e20bf8b4ee</id>
<content type='text'>
Gives all paths builtin objectmode values based on the paths' modes
(one of 100644, 100755, 120000, 040000, 160000). Users may use
this feature to filter by file types. For example a pathspec such as
':(attr:builtin_objectmode=160000)' could filter for submodules without
needing to have `builtin_objectmode=160000` to be set in .gitattributes
for every submodule path.

These values are also reflected in `git check-attr` results.
If the git_attr_direction is set to GIT_ATTR_INDEX or GIT_ATTR_CHECKIN
and a path is not found in the index, the value will be unspecified.

This patch also reserves the builtin_* attribute namespace for objectmode
and any future builtin attributes. Any user defined attributes using this
reserved namespace will result in a warning. This is a breaking change for
any existing builtin_* attributes.
Pathspecs with some builtin_* attribute name (excluding builtin_objectmode)
will behave like any attribute where there are no user specified values.

Signed-off-by: Joanna Wang &lt;jojwang@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: fix some typos, grammar and wording issues</title>
<updated>2023-10-05T19:55:38Z</updated>
<author>
<name>Štěpán Němec</name>
<email>stepnem@smrk.net</email>
</author>
<published>2023-10-05T09:00:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=97509a3497cf864bb1ed26229feb9437f76a30ee'/>
<id>urn:sha1:97509a3497cf864bb1ed26229feb9437f76a30ee</id>
<content type='text'>
Signed-off-by: Štěpán Němec &lt;stepnem@smrk.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ll-merge: killing the external merge driver aborts the merge</title>
<updated>2023-06-23T16:27:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-06-23T00:33:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b7b788fb31a74bcbff4e4c6efc6f3db6c3a49b7'/>
<id>urn:sha1:2b7b788fb31a74bcbff4e4c6efc6f3db6c3a49b7</id>
<content type='text'>
When an external merge driver dies with a signal, we should not
expect that the result left on the filesystem is in any useful
state.  However, because the current code uses the return value from
run_command() and declares any positive value as a sign that the
driver successfully left conflicts in the result, and because the
return value from run_command() for a subprocess that died upon a
signal is positive, we end up treating whatever garbage left on the
filesystem as the result the merge driver wanted to leave us.

run_command() returns larger than 128 (WTERMSIG(status) + 128, to be
exact) when it notices that the subprocess died with a signal, so
detect such a case and return LL_MERGE_ERROR from ll_ext_merge().

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
</content>
</entry>
<entry>
<title>docs: rewrite the documentation of the text and eol attributes</title>
<updated>2023-05-03T16:02:11Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2023-05-03T04:46:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6696077aced3847b49af2db8b7477b6823fa681b'/>
<id>urn:sha1:6696077aced3847b49af2db8b7477b6823fa681b</id>
<content type='text'>
These two sentences are confusing because the description of the text
attribute sounds exactly the same as the description of the text=auto
attribute:

"Setting the text attribute on a path enables end-of-line normalization"

"When text is set to "auto", the path is marked for automatic
end-of-line conversion"

Unless the reader is already familiar with the two variants, there's a
high probability that they will think that "end-of-line normalization"
is the same thing as "automatic end-of-line conversion".

It's also not clear that the phrase "When the file has been committed
with CRLF, no conversion is done" in the paragraph for text=auto does
not apply equally to the bare text attribute which is described earlier.
Moreover, it falsely implies that normalization is only suppressed if
the file has been committed. In fact, running `git add` on a CRLF file,
adding the text=auto attribute to the file, and running `git add` again
does not do anything to the line endings either.

On top of that, in several places the documentation for the eol
attribute sounds like either it does not affect normalization on checkin
or it forces normalization on checkin. It also sounds like setting eol
(or setting a config variable) is required to turn on conversion on
checkout, but the text attribute can turn on conversion on checkout by
itself if eol is unspecified.

Rephrase the documentation of text, text=auto, eol, eol=crlf, and eol=lf
to be clear about how they are the same, how they are different, and in
what cases conversion is performed.

Helped-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
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>Merge branch 'jc/diff-algo-attribute'</title>
<updated>2023-02-27T18:08:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-02-27T18:08:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ece8dc97ae53d08247aa283b6f299e3e5b2669db'/>
<id>urn:sha1:ece8dc97ae53d08247aa283b6f299e3e5b2669db</id>
<content type='text'>
The "diff" drivers specified by the "diff" attribute attached to
paths can now specify which algorithm (e.g. histogram) to use.

* jc/diff-algo-attribute:
  diff: teach diff to read algorithm from diff driver
  diff: consolidate diff algorithm option parsing
</content>
</entry>
<entry>
<title>diff: teach diff to read algorithm from diff driver</title>
<updated>2023-02-21T17:29:10Z</updated>
<author>
<name>John Cai</name>
<email>johncai86@gmail.com</email>
</author>
<published>2023-02-20T21:04:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a4cf900ee734ce9bb73d57c5dfbb1da4a5a88bd3'/>
<id>urn:sha1:a4cf900ee734ce9bb73d57c5dfbb1da4a5a88bd3</id>
<content type='text'>
It can be useful to specify diff algorithms per file type. For example,
one may want to use the minimal diff algorithm for .json files, another
for .c files, etc.

The diff machinery already checks attributes for a diff driver. Teach
the diff driver parser a new type "algorithm" to look for in the
config, which will be used if a driver has been specified through the
attributes.

Enforce precedence of the diff algorithm by favoring the command line
option, then looking at the driver attributes &amp; config combination, then
finally the diff.algorithm config.

To enforce precedence order, use a new `ignore_driver_algorithm` member
during options parsing to indicate the diff algorithm was set via command
line args.

Signed-off-by: John Cai &lt;johncai86@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
