<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/bundle.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-01-05T06:07:22Z</updated>
<entry>
<title>Merge branch 'ab/bundle-wo-args'</title>
<updated>2023-01-05T06:07:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-01-05T06:07:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc58ebf84e2729a60175baf6a7bb967b31f934bf'/>
<id>urn:sha1:bc58ebf84e2729a60175baf6a7bb967b31f934bf</id>
<content type='text'>
Fix to a small regression in 2.38 days.

* ab/bundle-wo-args:
  bundle &lt;cmd&gt;: have usage_msg_opt() note the missing "&lt;file&gt;"
  builtin/bundle.c: remove superfluous "newargc" variable
  bundle: don't segfault on "git bundle &lt;subcmd&gt;"
</content>
</entry>
<entry>
<title>bundle &lt;cmd&gt;: have usage_msg_opt() note the missing "&lt;file&gt;"</title>
<updated>2022-12-27T23:30:52Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-12-27T18:39:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d5e9e53aa46b97227a25c85400fd00b8237411a'/>
<id>urn:sha1:6d5e9e53aa46b97227a25c85400fd00b8237411a</id>
<content type='text'>
Improve the usage we emit on e.g. "git bundle create" to note why
we're showing the usage, it's because the "&lt;file&gt;" argument is
missing.

We know that'll be the case for all parse_options_cmd_bundle() users,
as they're passing the "char **bundle_file" parameter, which as the
context shows we're expected to populate.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/bundle.c: remove superfluous "newargc" variable</title>
<updated>2022-12-27T23:30:01Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-12-27T18:39:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e778ecbcee3a4a14e46c06d66328fdfc0af8780d'/>
<id>urn:sha1:e778ecbcee3a4a14e46c06d66328fdfc0af8780d</id>
<content type='text'>
As noted in 891cb09db6c (bundle: don't segfault on "git bundle
&lt;subcmd&gt;", 2022-12-20) the "newargc" in this function is redundant to
using our own "argc". Let's refactor the function to avoid needlessly
introducing another variable.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle: don't segfault on "git bundle &lt;subcmd&gt;"</title>
<updated>2022-12-25T07:01:09Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-12-20T13:40:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=891cb09db6c0e6bf11b8175bc5ea5f45493afb85'/>
<id>urn:sha1:891cb09db6c0e6bf11b8175bc5ea5f45493afb85</id>
<content type='text'>
Since aef7d75e580 (builtin/bundle.c: let parse-options parse
subcommands, 2022-08-19) we've been segfaulting if no argument was
provided.

The fix is easy, as all of the "git bundle" subcommands require a
non-option argument we can check that we have arguments left after
calling parse-options().

This makes use of code added in 73c3253d75e (bundle: framework for
options before bundle file, 2019-11-10), before this change that code
has always been unreachable. In 73c3253d75e we'd never reach it as we
already checked "argc &lt; 2" in cmd_bundle() itself.

Then when aef7d75e580 (whose segfault we're fixing here) migrated this
code to the subcommand API it removed that "argc &lt; 2" check, but we
were still checking the wrong "argc" in parse_options_cmd_bundle(), we
need to check the "newargc". The "argc" will always be &gt;= 1, as it
will necessarily contain at least the subcommand name
itself (e.g. "create").

As an aside, this could be safely squashed into this, but let's not do
that for this minimal segfault fix, as it's an unrelated refactoring:

	--- a/builtin/bundle.c
	+++ b/builtin/bundle.c
	@@ -55,13 +55,12 @@ static int parse_options_cmd_bundle(int argc,
	 		const char * const usagestr[],
	 		const struct option options[],
	 		char **bundle_file) {
	-	int newargc;
	-	newargc = parse_options(argc, argv, NULL, options, usagestr,
	+	argc = parse_options(argc, argv, NULL, options, usagestr,
	 			     PARSE_OPT_STOP_AT_NON_OPTION);
	-	if (!newargc)
	+	if (!argc)
	 		usage_with_options(usagestr, options);
	 	*bundle_file = prefix_filename(prefix, argv[0]);
	-	return newargc;
	+	return argc;
	 }

	 static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {

Reported-by: Hubert Jasudowicz &lt;hubertj@stmcyber.pl&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Tested-by: Hubert Jasudowicz &lt;hubertj@stmcyber.pl&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/bundle-uri-3'</title>
<updated>2022-10-31T01:04:44Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-10-31T01:04:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d32dd8add53120cef9b30be4240010c2ab6bfc6f'/>
<id>urn:sha1:d32dd8add53120cef9b30be4240010c2ab6bfc6f</id>
<content type='text'>
Define the logical elements of a "bundle list", data structure to
store them in-core, format to transfer them, and code to parse
them.

* ds/bundle-uri-3:
  bundle-uri: suppress stderr from remote-https
  bundle-uri: quiet failed unbundlings
  bundle: add flags to verify_bundle()
  bundle-uri: fetch a list of bundles
  bundle: properly clear all revision flags
  bundle-uri: limit recursion depth for bundle lists
  bundle-uri: parse bundle list in config format
  bundle-uri: unit test "key=value" parsing
  bundle-uri: create "key=value" line parsing
  bundle-uri: create base key-value pair parsing
  bundle-uri: create bundle_list struct and helpers
  bundle-uri: use plain string in find_temp_filename()
</content>
</entry>
<entry>
<title>doc txt &amp; -h consistency: make "bundle" consistent</title>
<updated>2022-10-13T16:32:57Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-10-13T15:39:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5748670e387dd32450a59b00d17044a34818b9a'/>
<id>urn:sha1:a5748670e387dd32450a59b00d17044a34818b9a</id>
<content type='text'>
Amend the -h output to match that of the *.txt output, the differences
were fairly small. In the case of "[&lt;options&gt;]" we only have a few of
them, so let's exhaustively list them as in the *.txt.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle: define subcommand -h in terms of command -h</title>
<updated>2022-10-13T16:32:54Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-10-13T15:38:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f587d16471a8ce438b7d19afe6f3cdbf5a42cb63'/>
<id>urn:sha1:f587d16471a8ce438b7d19afe6f3cdbf5a42cb63</id>
<content type='text'>
Avoid repeating the "-h" output for the "git bundle" command, and
instead define the usage of each subcommand with macros, so that the
"-h" output for the command itself can re-use those definitions. See
[1], [2] and [3] for prior art using the same pattern.

1. b25b727494f (builtin/multi-pack-index.c: define common usage with a
   macro, 2021-03-30)
2. 8757b35d443 (commit-graph: define common usage with a macro,
   2021-08-23)
3. 1e91d3faf6c (reflog: move "usage" variables and use macros,
   2022-03-17)

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/bundle.c: indent with tabs</title>
<updated>2022-10-13T16:32:54Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-10-13T15:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=968a04e4478dff3aacbdd225e436fc2ec1c6a76a'/>
<id>urn:sha1:968a04e4478dff3aacbdd225e436fc2ec1c6a76a</id>
<content type='text'>
Fix indentation issues introduced with 73c3253d75e (bundle: framework
for options before bundle file, 2019-11-10), and carried forward in
some subsequent commits.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle-uri: quiet failed unbundlings</title>
<updated>2022-10-12T16:13:25Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-10-12T12:52:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=70334fc3ebf1c6199014d82bbbf0595b64a8fa90'/>
<id>urn:sha1:70334fc3ebf1c6199014d82bbbf0595b64a8fa90</id>
<content type='text'>
When downloading a list of bundles in "all" mode, Git has no
understanding of the dependencies between the bundles. Git attempts to
unbundle the bundles in some order, but some may not pass the
verify_bundle() step because of missing prerequisites. This is passed as
error messages to the user, even when they eventually succeed in later
attempts after their dependent bundles are unbundled.

Add a new VERIFY_BUNDLE_QUIET flag to verify_bundle() that avoids the
error messages from the missing prerequisite commits. The method still
returns the number of missing prerequisit commits, allowing callers to
unbundle() to notice that the bundle failed to apply.

Use this flag in bundle-uri.c and test that the messages go away for
'git clone --bundle-uri' commands.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle: add flags to verify_bundle()</title>
<updated>2022-10-12T16:13:25Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-10-12T12:52:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89bd7fedf947484da08e2722d663fdac23a431be'/>
<id>urn:sha1:89bd7fedf947484da08e2722d663fdac23a431be</id>
<content type='text'>
The verify_bundle() method has a 'verbose' option, but we will want to
extend this method to have more granular control over its output. First,
replace this 'verbose' option with a new 'flags' option with a single
possible value: VERIFY_BUNDLE_VERBOSE.

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