<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/log-tree.c, branch v2.47.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.47.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.47.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-11-25T03:29:39Z</updated>
<entry>
<title>Merge branch 'jk/output-prefix-cleanup' into maint-2.47</title>
<updated>2024-11-25T03:29:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-11-25T03:29:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b03fd8dcd1fd88ad834a3b3f678631d6d68ea54'/>
<id>urn:sha1:6b03fd8dcd1fd88ad834a3b3f678631d6d68ea54</id>
<content type='text'>
Code clean-up.

* jk/output-prefix-cleanup:
  diff: store graph prefix buf in git_graph struct
  diff: return line_prefix directly when possible
  diff: return const char from output_prefix callback
  diff: drop line_prefix_length field
  line-log: use diff_line_prefix() instead of custom helper
</content>
</entry>
<entry>
<title>diff: return const char from output_prefix callback</title>
<updated>2024-10-03T21:22:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-10-03T21:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=436728fe9d75d05fa2439f867ca2039012b86e69'/>
<id>urn:sha1:436728fe9d75d05fa2439f867ca2039012b86e69</id>
<content type='text'>
The diff_options structure has an output_prefix callback for returning a
prefix string, but it does so by returning a pointer to a strbuf.

This makes the interface awkward. There's no reason the callback should
need to use a strbuf, and it creates questions about whether the
ownership of the resulting buffer should be transferred to the caller
(it should not be, but a recent attempt to clean up this code led to a
double-free in some cases).

The one advantage we get is that the strbuf contains a ptr/len pair, so
we could in theory have a prefix with embedded NULs. But we can observe
that none of the existing callbacks would ever produce such a NUL (they
are usually just indentation or graph symbols, and even the
"--line-prefix" option takes a NUL-terminated string).

And anyway, only one caller (the one in log_tree_diff_flush) actually
looks at the strbuf length. In every other case we use a helper function
which discards the length and just returns the NUL-terminated string.

So let's just have the callback return a "const char *" pointer. It's up
to the callbacks themselves if they want to use a strbuf under the hood.
And now the caller in log_tree_diff_flush() can just use the helper
function along with everybody else. That lets us even simplify out the
function pointer check, since the helper returns an empty string
(technically this does mean we'll sometimes issue an empty fputs() call,
but I don't think this code path is hot enough to care about that).

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>Merge branch 'jc/range-diff-lazy-setup'</title>
<updated>2024-09-16T21:22:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-09-16T21:22:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be8ca2848a9e73f6ddc31ebce2ddc3c367d4f0cb'/>
<id>urn:sha1:be8ca2848a9e73f6ddc31ebce2ddc3c367d4f0cb</id>
<content type='text'>
Code clean-up.

* jc/range-diff-lazy-setup:
  remerge-diff: clean up temporary objdir at a central place
  remerge-diff: lazily prepare temporary objdir on demand
</content>
</entry>
<entry>
<title>Merge branch 'rs/use-decimal-width' into maint-2.46</title>
<updated>2024-08-26T18:10:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-08-26T18:10:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a7bd3d0cb2b08b29edfe51b61893dc6856e74f0'/>
<id>urn:sha1:9a7bd3d0cb2b08b29edfe51b61893dc6856e74f0</id>
<content type='text'>
Code clean-up.

* rs/use-decimal-width:
  log-tree: use decimal_width()
</content>
</entry>
<entry>
<title>Merge branch 'jc/refs-symref-referent'</title>
<updated>2024-08-15T20:22:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-08-15T20:22:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7f86cb69de9c3b95c8c8816b51621c1d7910e02'/>
<id>urn:sha1:e7f86cb69de9c3b95c8c8816b51621c1d7910e02</id>
<content type='text'>
The refs API has been taught to give symref target information to
the users of ref iterators, allowing for-each-ref and friends to
avoid an extra ref_resolve_* API call per a symbolic ref.

* jc/refs-symref-referent:
  ref-filter: populate symref from iterator
  refs: add referent to each_ref_fn
  refs: keep track of unresolved reference value in iterators
</content>
</entry>
<entry>
<title>Merge branch 'rs/use-decimal-width'</title>
<updated>2024-08-14T21:54:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-08-14T21:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4a443f00c4988e1e59e919c3c4a8873a0d1c2b5a'/>
<id>urn:sha1:4a443f00c4988e1e59e919c3c4a8873a0d1c2b5a</id>
<content type='text'>
Code clean-up.

* rs/use-decimal-width:
  log-tree: use decimal_width()
</content>
</entry>
<entry>
<title>remerge-diff: lazily prepare temporary objdir on demand</title>
<updated>2024-08-09T22:42:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-08-09T22:30:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=245cac5c3312b9afab5c47cb222f0e5d1845da0d'/>
<id>urn:sha1:245cac5c3312b9afab5c47cb222f0e5d1845da0d</id>
<content type='text'>
It is error prone for each caller that sets revs.remerge_diff bit
to be responsible for preparing a temporary object directory and
rotate it into the list of alternate object stores, making it the
primary object store.

Instead, remove the code to set up and arrange the temporary object
directory from the current callers and implement it in the code that
runs remerge-diff logic.  The code to undo the futzing of the list
of alternate object store is still spread across the callers, but we
will deal with it in future steps.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: add referent to each_ref_fn</title>
<updated>2024-08-09T15:47:34Z</updated>
<author>
<name>John Cai</name>
<email>johncai86@gmail.com</email>
</author>
<published>2024-08-09T15:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8207717f1623325fe1c95338fb03c1104ed5687'/>
<id>urn:sha1:e8207717f1623325fe1c95338fb03c1104ed5687</id>
<content type='text'>
Add a parameter to each_ref_fn so that callers to the ref APIs
that use this function as a callback can have acess to the
unresolved value of a symbolic ref.

Signed-off-by: John Cai &lt;johncai86@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>log-tree: use decimal_width()</title>
<updated>2024-08-05T15:59:40Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-08-03T12:33:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c4d5aa22d65fb395962bdc0165840f66b7b91ea'/>
<id>urn:sha1:0c4d5aa22d65fb395962bdc0165840f66b7b91ea</id>
<content type='text'>
Reduce code duplication by calling decimal_width() to count the digits
in the number of commits instead of calculating it locally.

It also has the advantage of returning int, which is the exact type
expected by the printf()-like function strbuf_addf() for field width
arguments.

Additionally, decimal_width() supports numbers bigger than 1410065407,
which is (hopefully) just a theoretical advantage.

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-recursive: honor diff.algorithm</title>
<updated>2024-07-14T01:10:49Z</updated>
<author>
<name>Antonin Delpeuch</name>
<email>antonin@delpeuch.eu</email>
</author>
<published>2024-07-13T16:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9c93ba4d0aee1bc8c663a13552afd2b2c22863a9'/>
<id>urn:sha1:9c93ba4d0aee1bc8c663a13552afd2b2c22863a9</id>
<content type='text'>
The documentation claims that "recursive defaults to the diff.algorithm
config setting", but this is currently not the case. This fixes it,
ensuring that diff.algorithm is used when -Xdiff-algorithm is not
supplied. This affects the following porcelain commands: "merge",
"rebase", "cherry-pick", "pull", "stash", "log", "am" and "checkout".
It also affects the "merge-tree" ancillary interrogator.

This change refactors the initialization of merge options to introduce
two functions, "init_merge_ui_options" and "init_merge_basic_options"
instead of just one "init_merge_options". This design follows the
approach used in diff.c, providing initialization methods for
porcelain and plumbing commands respectively. Thanks to that, the
"replay" and "merge-recursive" plumbing commands remain unaffected by
diff.algorithm.

Signed-off-by: Antonin Delpeuch &lt;antonin@delpeuch.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
