<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-write.c, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-11-25T23:24:52Z</updated>
<entry>
<title>Merge branch 'rs/hashwrite-be64'</title>
<updated>2020-11-25T23:24:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-25T23:24:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=455e8d18f81583d0270685edc6ec2ed201fc984c'/>
<id>urn:sha1:455e8d18f81583d0270685edc6ec2ed201fc984c</id>
<content type='text'>
Code simplification.

* rs/hashwrite-be64:
  pack-write: use hashwrite_be64()
  midx: use hashwrite_be64()
  csum-file: add hashwrite_be64()
</content>
</entry>
<entry>
<title>pack-write: use hashwrite_be64()</title>
<updated>2020-11-12T17:40:10Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-11-12T12:23:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=970909c2a7803564f82ab1d3660d77ad6a44b68f'/>
<id>urn:sha1:970909c2a7803564f82ab1d3660d77ad6a44b68f</id>
<content type='text'>
Call hashwrite_be64() to write a 64-bit value instead of open-coding it
using htonl() and hashwrite().  This shortens the code, gets rid of a
buffer and several magic numbers, and makes the intent clearer.

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>pack-write: use hashwrite_be32() instead of double-buffering array</title>
<updated>2020-11-01T23:52:51Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-11-01T08:52:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06d43fad18a2bb85b1a224b07c4cc572c7e41f7e'/>
<id>urn:sha1:06d43fad18a2bb85b1a224b07c4cc572c7e41f7e</id>
<content type='text'>
hashwrite() already buffers writes, so pass the fanout table entries
individually via hashwrite_be32(), which also does the endianess
conversion for us.  This avoids a memory copy, shortens the code and
reduces the number of magic numbers.

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>pack-write: use hashwrite_be32() in write_idx_file()</title>
<updated>2020-09-19T19:15:36Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-09-19T18:26:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=389cf68caf8bc79669133c8744b06092925461e0'/>
<id>urn:sha1:389cf68caf8bc79669133c8744b06092925461e0</id>
<content type='text'>
Call hashwrite_be32() instead of open-coding it.  This shortens the code
a bit and makes it easier to read.

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 branch 'jb/doc-packfile-name' into master</title>
<updated>2020-07-31T04:34:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-31T04:34:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d61aed07bd0c61420879f42b4b961785ed1f742a'/>
<id>urn:sha1:d61aed07bd0c61420879f42b4b961785ed1f742a</id>
<content type='text'>
Doc update.

* jb/doc-packfile-name:
  pack-write/docs: update regarding pack naming
</content>
</entry>
<entry>
<title>pack-write/docs: update regarding pack naming</title>
<updated>2020-07-22T22:38:22Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes@sipsolutions.net</email>
</author>
<published>2020-07-22T21:40:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2bfa50ac3bfc697f3caa623213acbf591cdfa8e'/>
<id>urn:sha1:e2bfa50ac3bfc697f3caa623213acbf591cdfa8e</id>
<content type='text'>
The index-pack documentation explicitly states that the pack
name is derived from the sorted list of object names, but
since commit 1190a1acf800 ("pack-objects: name pack files
after trailer hash") that isn't true anymore.

Be less explicit in the docs as to what the exact output is,
and just say that it's whatever goes into the pack name.

Also update a comment on write_idx_file() since it no longer
modifies the sha1 variable (it's const now anyway), as noted
by Junio.

Fixes: 1190a1acf800 ("pack-objects: name pack files after trailer hash")
Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-write: use hash_to_hex when writing checksums</title>
<updated>2019-08-19T22:04:58Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-08-18T20:04:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=894c0f66bb21189d0677be6ecb9923b6acfbf437'/>
<id>urn:sha1:894c0f66bb21189d0677be6ecb9923b6acfbf437</id>
<content type='text'>
Pack checksums always use the current hash algorithm in use, so switch
from sha1_to_hex to hash_to_hex.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert "hashcmp() != 0" to "!hasheq()"</title>
<updated>2018-08-29T18:32:49Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-08-28T21:22:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67947c34ae8f666e72b9406a38984fe8386f5e50'/>
<id>urn:sha1:67947c34ae8f666e72b9406a38984fe8386f5e50</id>
<content type='text'>
This rounds out the previous three patches, covering the
inequality logic for the "hash" variant of the functions.

As with the previous three, the accompanying code changes
are the mechanical result of applying the coccinelle patch;
see those patches for more discussion.

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>convert "oidcmp() == 0" to oideq()</title>
<updated>2018-08-29T18:32:49Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-08-28T21:22:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4a7e27e95797c0a094f8ee300a260777ddd7eec9'/>
<id>urn:sha1:4a7e27e95797c0a094f8ee300a260777ddd7eec9</id>
<content type='text'>
Using the more restrictive oideq() should, in the long run,
give the compiler more opportunities to optimize these
callsites. For now, this conversion should be a complete
noop with respect to the generated code.

The result is also perhaps a little more readable, as it
avoids the "zero is equal" idiom. Since it's so prevalent in
C, I think seasoned programmers tend not to even notice it
anymore, but it can sometimes make for awkward double
negations (e.g., we can drop a few !!oidcmp() instances
here).

This patch was generated almost entirely by the included
coccinelle patch. This mechanical conversion should be
completely safe, because we check explicitly for cases where
oidcmp() is compared to 0, which is what oideq() is doing
under the hood. Note that we don't have to catch "!oidcmp()"
separately; coccinelle's standard isomorphisms make sure the
two are treated equivalently.

I say "almost" because I did hand-edit the coccinelle output
to fix up a few style violations (it mostly keeps the
original formatting, but sometimes unwraps long lines).

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>csum-file: refactor finalize_hashfile() method</title>
<updated>2018-04-02T21:27:30Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-02T20:34:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cfe83216e404223ce8c5f6ef79c4ba9a27ff872e'/>
<id>urn:sha1:cfe83216e404223ce8c5f6ef79c4ba9a27ff872e</id>
<content type='text'>
If we want to use a hashfile on the temporary file for a lockfile, then
we need finalize_hashfile() to fully write the trailing hash but also keep
the file descriptor open.

Do this by adding a new CSUM_HASH_IN_STREAM flag along with a functional
change that checks this flag before writing the checksum to the stream.
This differs from previous behavior since it would be written if either
CSUM_CLOSE or CSUM_FSYNC is provided.

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