<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/convert.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-09-30T19:53:47Z</updated>
<entry>
<title>convert: drop unused crlf_action from check_global_conv_flags_eol()</title>
<updated>2020-09-30T19:53:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-09-30T12:27:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=185e86522678fed077d6cec02381bcf899bf24e5'/>
<id>urn:sha1:185e86522678fed077d6cec02381bcf899bf24e5</id>
<content type='text'>
The crlf_action parameter hasn't been used since a0ad53c181 (convert:
Correct NNO tests and missing `LF will be replaced by CRLF`,
2016-08-13), where that part of the function was hoisted out to a
separate will_convert_lf_to_crlf() helper. Let's drop the useless
parameter.

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>run_command: teach API users to use embedded 'args' more</title>
<updated>2020-08-26T22:32:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-26T22:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afbdba391eaf3c473eff8f12437ff510935b520f'/>
<id>urn:sha1:afbdba391eaf3c473eff8f12437ff510935b520f</id>
<content type='text'>
The child_process structure has an embedded strvec for formulating
the command line argument list these days, but code that predates
the wide use of it prepared a separate char *argv[] array and
manually set the child_process.argv pointer point at it.

Teach these old-style code to lose the separate argv[] array.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse_config_key(): return subsection len as size_t</title>
<updated>2020-04-10T21:44:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-04-10T19:44:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5914f4b6bcdb517733c761fe5ba9d94471eb01d'/>
<id>urn:sha1:f5914f4b6bcdb517733c761fe5ba9d94471eb01d</id>
<content type='text'>
We return the length to a subset of a string using an "int *"
out-parameter. This is fine most of the time, as we'd expect config keys
to be relatively short, but it could behave oddly if we had a gigantic
config key. A more appropriate type is size_t.

Let's switch over, which lets our callers use size_t as appropriate
(they are bound by our type because they must pass the out-parameter as
a pointer). This is mostly just a cleanup to make it clear this code
handles long strings correctly. In practice, our config parser already
chokes on long key names (because of a similar int/size_t mixup!).

When doing an int/size_t conversion, we have to be careful that nobody
was trying to assign a negative value to the variable. I manually
confirmed that for each case here. They tend to just feed the result to
xmemdupz() or similar; in a few cases I adjusted the parameter types for
helper functions to make sure the size_t is preserved.

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: provide additional metadata to filters</title>
<updated>2020-03-16T18:37:02Z</updated>
<author>
<name>brian m. carlson</name>
<email>bk2204@github.com</email>
</author>
<published>2020-03-16T18:05:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c397aac02f9f97976f675115aa5df6ca01e26d59'/>
<id>urn:sha1:c397aac02f9f97976f675115aa5df6ca01e26d59</id>
<content type='text'>
Now that we have the codebase wired up to pass any additional metadata
to filters, let's collect the additional metadata that we'd like to
pass.

The two main places we pass this metadata are checkouts and archives.
In these two situations, reading HEAD isn't a valid option, since HEAD
isn't updated for checkouts until after the working tree is written and
archives can accept an arbitrary tree.  In other situations, HEAD will
usually reflect the refname of the branch in current use.

We pass a smaller amount of data in other cases, such as git cat-file,
where we can really only logically know about the blob.

This commit updates only the parts of the checkout code where we don't
use unpack_trees.  That function and callers of it will be handled in a
future commit.

In the archive code, we leak a small amount of memory, since nothing we
pass in the archiver argument structure is freed.

Signed-off-by: brian m. carlson &lt;bk2204@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert: permit passing additional metadata to filter processes</title>
<updated>2020-03-16T18:37:02Z</updated>
<author>
<name>brian m. carlson</name>
<email>bk2204@github.com</email>
</author>
<published>2020-03-16T18:05:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab90ecae992e44e3e8303f143ad858608acabcf5'/>
<id>urn:sha1:ab90ecae992e44e3e8303f143ad858608acabcf5</id>
<content type='text'>
There are a variety of situations where a filter process can make use of
some additional metadata.  For example, some people find the ident
filter too limiting and would like to include the commit or the branch
in their smudged files.  This information isn't available during
checkout as HEAD hasn't been updated at that point, and it wouldn't be
available in archives either.

Let's add a way to pass this metadata down to the filter.  We pass the
blob we're operating on, the treeish (preferring the commit over the
tree if one exists), and the ref we're operating on.  Note that we won't
pass this information in all cases, such as when renormalizing or when
we're performing diffs, since it doesn't make sense in those cases.

The data we currently get from the filter process looks like the
following:

  command=smudge
  pathname=git.c
  0000

With this change, we'll get data more like this:

  command=smudge
  pathname=git.c
  refname=refs/tags/v2.25.1
  treeish=c522f061d551c9bb8684a7c3859b2ece4499b56b
  blob=7be7ad34bd053884ec48923706e70c81719a8660
  0000

There are a couple things to note about this approach.  For operations
like checkout, treeish will always be a commit, since we cannot check
out individual trees, but for other operations, like archive, we can end
up operating on only a particular tree, so we'll provide only a tree as
the treeish.  Similar comments apply for refname, since there are a
variety of cases in which we won't have a ref.

This commit wires up the code to print this information, but doesn't
pass any of it at this point.  In a future commit, we'll have various
code paths pass the actual useful data down.

Signed-off-by: brian m. carlson &lt;bk2204@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mt/use-passed-repo-more-in-funcs'</title>
<updated>2020-02-14T20:54:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-02-14T20:54:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78e67cda42a440f216fc4cbfd8a9e190c5eece5a'/>
<id>urn:sha1:78e67cda42a440f216fc4cbfd8a9e190c5eece5a</id>
<content type='text'>
Some codepaths were given a repository instance as a parameter to
work in the repository, but passed the_repository instance to its
callees, which has been cleaned up (somewhat).

* mt/use-passed-repo-more-in-funcs:
  sha1-file: allow check_object_signature() to handle any repo
  sha1-file: pass git_hash_algo to hash_object_file()
  sha1-file: pass git_hash_algo to write_object_file_prepare()
  streaming: allow open_istream() to handle any repo
  pack-check: use given repo's hash_algo at verify_packfile()
  cache-tree: use given repo's hash_algo at verify_one()
  diff: make diff_populate_filespec() honor its repo argument
</content>
</entry>
<entry>
<title>Merge branch 'js/convert-typofix'</title>
<updated>2020-02-12T20:41:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-02-12T20:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a3dcf84df0557df65d0b90bb732f26e84196566c'/>
<id>urn:sha1:a3dcf84df0557df65d0b90bb732f26e84196566c</id>
<content type='text'>
Typofix.

* js/convert-typofix:
  convert: fix typo
</content>
</entry>
<entry>
<title>convert: fix typo</title>
<updated>2020-02-11T20:03:09Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-02-11T18:56:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b0f19fa7a51fee27d03d08c5f4abceecd310c3f'/>
<id>urn:sha1:2b0f19fa7a51fee27d03d08c5f4abceecd310c3f</id>
<content type='text'>
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sha1-file: pass git_hash_algo to hash_object_file()</title>
<updated>2020-01-31T18:45:39Z</updated>
<author>
<name>Matheus Tavares</name>
<email>matheus.bernardino@usp.br</email>
</author>
<published>2020-01-30T20:32:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2dcde20e1c55fc2e3f9e9e6d48e93c39ec5661d2'/>
<id>urn:sha1:2dcde20e1c55fc2e3f9e9e6d48e93c39ec5661d2</id>
<content type='text'>
Allow hash_object_file() to work on arbitrary repos by introducing a
git_hash_algo parameter. Change callers which have a struct repository
pointer in their scope to pass on the git_hash_algo from the said repo.
For all other callers, pass on the_hash_algo, which was already being
used internally at hash_object_file(). This functionality will be used
in the following patch to make check_object_signature() be able to work
on arbitrary repos (which, in turn, will be used to fix an
inconsistency at object.c:parse_object()).

Signed-off-by: Matheus Tavares &lt;matheus.bernardino@usp.br&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/skip-iprefix'</title>
<updated>2019-12-01T17:04:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-01T17:04:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2489ce92c9ce81b3701a5e25547b969cb6e5209'/>
<id>urn:sha1:d2489ce92c9ce81b3701a5e25547b969cb6e5209</id>
<content type='text'>
Code simplification.

* rs/skip-iprefix:
  convert: use skip_iprefix() in validate_encoding()
  utf8: use skip_iprefix() in same_utf_encoding()
</content>
</entry>
</feed>
