<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-write.c, branch v2.29.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.29.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.29.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-09-19T19:15:36Z</updated>
<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>
<entry>
<title>csum-file: rename hashclose() to finalize_hashfile()</title>
<updated>2018-04-02T21:27:30Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-02T20:34:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f2af9f5e02380ba3868df7daa34368945d500206'/>
<id>urn:sha1:f2af9f5e02380ba3868df7daa34368945d500206</id>
<content type='text'>
The hashclose() method behaves very differently depending on the flags
parameter. In particular, the file descriptor is not always closed.

Perform a simple rename of "hashclose()" to "finalize_hashfile()" in
preparation for functional changes.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>csum-file: rename sha1file to hashfile</title>
<updated>2018-02-02T19:28:41Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-02-01T02:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98a3beab6a218eeed33c82fef697c0fd8181ea95'/>
<id>urn:sha1:98a3beab6a218eeed33c82fef697c0fd8181ea95</id>
<content type='text'>
Rename struct sha1file to struct hashfile, along with all of its related
functions.

The transformation in this commit was made by global search-and-replace.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-write: switch various SHA-1 values to abstract forms</title>
<updated>2018-02-02T19:28:41Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-02-01T02:18:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=81c58cd452c3da42abdcbec77cb59cf1352216ea'/>
<id>urn:sha1:81c58cd452c3da42abdcbec77cb59cf1352216ea</id>
<content type='text'>
Convert various uses of hardcoded 20- and 40-based numbers to use
the_hash_algo, along with direct calls to SHA-1.  Adjust the names of
variables to refer to "hash" instead of "sha1".

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
