git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* [PATCH] Use user supplied origin name for extension.partialcone instead of hardcoded value.
@ 2019-05-23 23:55 Xin Li
  2019-05-24  0:01 ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Xin Li @ 2019-05-23 23:55 UTC (permalink / raw)
  To: git; +Cc: Xin Li, jonathantanmy

Signed-off-by: Xin Li <delphij@google.com>
---
 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 50bde99618..822208a346 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1215,7 +1215,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			remote_head_points_at, &branch_top);
 
 	if (filter_options.choice)
-		partial_clone_register("origin", &filter_options);
+		partial_clone_register(option_origin, &filter_options);
 
 	if (is_local)
 		clone_local(path, git_dir);
-- 
2.22.0.rc1.257.g3120a18244-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Use user supplied origin name for extension.partialcone instead of hardcoded value.
  2019-05-23 23:55 [PATCH] Use user supplied origin name for extension.partialcone instead of hardcoded value Xin Li
@ 2019-05-24  0:01 ` Jonathan Nieder
  2019-05-24  0:15   ` [PATCH] clone: respect user supplied origin name when setting up partial clone Xin Li
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2019-05-24  0:01 UTC (permalink / raw)
  To: Xin Li; +Cc: git, jonathantanmy, Junio C Hamano

Xin Li wrote:

> Subject: Use user supplied origin name for extension.partialcone instead of hardcoded value.

Good catch!

Nits:

- s/partialcone/partialclone/ (missing "l")

- subject lines in git.git tend to be of the form
  "subsystem: lowercase summary" with no trailing period.  So maybe
  something like:

	clone: respect user supplied origin name when setting up partial clone

> Signed-off-by: Xin Li <delphij@google.com>
> ---
>  builtin/clone.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

The change looks obviously good.  With or without a commit message
change like suggested above,

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] clone: respect user supplied origin name when setting up partial clone
  2019-05-24  0:01 ` Jonathan Nieder
@ 2019-05-24  0:15   ` Xin Li
  2019-05-29 19:59     ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Xin Li @ 2019-05-24  0:15 UTC (permalink / raw)
  To: git; +Cc: Xin Li, Jonathan Nieder

Signed-off-by: Xin Li <delphij@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 50bde99618..822208a346 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1215,7 +1215,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			remote_head_points_at, &branch_top);
 
 	if (filter_options.choice)
-		partial_clone_register("origin", &filter_options);
+		partial_clone_register(option_origin, &filter_options);
 
 	if (is_local)
 		clone_local(path, git_dir);
-- 
2.22.0.rc1.257.g3120a18244-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] clone: respect user supplied origin name when setting up partial clone
  2019-05-24  0:15   ` [PATCH] clone: respect user supplied origin name when setting up partial clone Xin Li
@ 2019-05-29 19:59     ` Junio C Hamano
  2019-05-29 21:16       ` [PATCH v3] " Xin Li
  0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2019-05-29 19:59 UTC (permalink / raw)
  To: Xin Li; +Cc: git, Jonathan Nieder

Xin Li <delphij@google.com> writes:

> Signed-off-by: Xin Li <delphij@google.com>
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
>  builtin/clone.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks.  Can you add a test to demonstrate existing breakage without
this single-line code change in the same patch?

>
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 50bde99618..822208a346 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -1215,7 +1215,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
>  			remote_head_points_at, &branch_top);
>  
>  	if (filter_options.choice)
> -		partial_clone_register("origin", &filter_options);
> +		partial_clone_register(option_origin, &filter_options);
>  
>  	if (is_local)
>  		clone_local(path, git_dir);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3] clone: respect user supplied origin name when setting up partial clone
  2019-05-29 19:59     ` Junio C Hamano
@ 2019-05-29 21:16       ` Xin Li
  2019-05-29 21:22         ` [PATCH v4] " Xin Li
  0 siblings, 1 reply; 7+ messages in thread
From: Xin Li @ 2019-05-29 21:16 UTC (permalink / raw)
  To: gitster, jrnieder, git; +Cc: Xin Li

Signed-off-by: Xin Li <delphij@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c  |  2 +-
 t/t5601-clone.sh | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 50bde99618..822208a346 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1215,7 +1215,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			remote_head_points_at, &branch_top);
 
 	if (filter_options.choice)
-		partial_clone_register("origin", &filter_options);
+		partial_clone_register(option_origin, &filter_options);
 
 	if (is_local)
 		clone_local(path, git_dir);
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index d6948cbdab..3595162c32 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -634,7 +634,7 @@ test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
 	test_i18ngrep "the following paths have collided" icasefs/warning
 '
 
-partial_clone () {
+partial_clone_server () {
 	       SERVER="$1" &&
 	       URL="$2" &&
 
@@ -646,8 +646,14 @@ partial_clone () {
 	test_commit -C "$SERVER" two &&
 	HASH2=$(git hash-object "$SERVER/two.t") &&
 	test_config -C "$SERVER" uploadpack.allowfilter 1 &&
-	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1 &&
+	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1
+}
+
+partial_clone () {
+	       SERVER="$1" &&
+	       URL="$2" &&
 
+	partial_clone_server "${SERVER}" "${URL}" &&
 	git clone --filter=blob:limit=0 "$URL" client &&
 
 	git -C client fsck &&
@@ -664,6 +670,11 @@ test_expect_success 'partial clone' '
 	partial_clone server "file://$(pwd)/server"
 '
 
+test_expect_success 'partial clone with -o' '
+	partial_clone_server server "file://$(pwd)/server" &&
+	git clone -o blah --filter=blob:limit=0 "${URL}" client
+'
+
 test_expect_success 'partial clone: warn if server does not support object filtering' '
 	rm -rf server client &&
 	test_create_repo server &&
-- 
2.22.0.rc1.257.g3120a18244-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v4] clone: respect user supplied origin name when setting up partial clone
  2019-05-29 21:16       ` [PATCH v3] " Xin Li
@ 2019-05-29 21:22         ` Xin Li
  2019-05-29 21:26           ` [PATCH v5] " Xin Li
  0 siblings, 1 reply; 7+ messages in thread
From: Xin Li @ 2019-05-29 21:22 UTC (permalink / raw)
  To: gitster, jrnieder, git; +Cc: Xin Li

Signed-off-by: Xin Li <delphij@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c  |  2 +-
 t/t5601-clone.sh | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 50bde99618..822208a346 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1215,7 +1215,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			remote_head_points_at, &branch_top);
 
 	if (filter_options.choice)
-		partial_clone_register("origin", &filter_options);
+		partial_clone_register(option_origin, &filter_options);
 
 	if (is_local)
 		clone_local(path, git_dir);
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index d6948cbdab..22066bb88c 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -634,9 +634,8 @@ test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
 	test_i18ngrep "the following paths have collided" icasefs/warning
 '
 
-partial_clone () {
+partial_clone_server () {
 	       SERVER="$1" &&
-	       URL="$2" &&
 
 	rm -rf "$SERVER" client &&
 	test_create_repo "$SERVER" &&
@@ -646,8 +645,14 @@ partial_clone () {
 	test_commit -C "$SERVER" two &&
 	HASH2=$(git hash-object "$SERVER/two.t") &&
 	test_config -C "$SERVER" uploadpack.allowfilter 1 &&
-	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1 &&
+	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1
+}
 
+partial_clone () {
+	       SERVER="$1" &&
+	       URL="$2" &&
+
+	partial_clone_server "${SERVER}" &&
 	git clone --filter=blob:limit=0 "$URL" client &&
 
 	git -C client fsck &&
@@ -664,6 +669,11 @@ test_expect_success 'partial clone' '
 	partial_clone server "file://$(pwd)/server"
 '
 
+test_expect_success 'partial clone with -o' '
+	partial_clone_server server "file://$(pwd)/server" &&
+	git clone -o blah --filter=blob:limit=0 "file://$(pwd)/server" client
+'
+
 test_expect_success 'partial clone: warn if server does not support object filtering' '
 	rm -rf server client &&
 	test_create_repo server &&
-- 
2.22.0.rc1.257.g3120a18244-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5] clone: respect user supplied origin name when setting up partial clone
  2019-05-29 21:22         ` [PATCH v4] " Xin Li
@ 2019-05-29 21:26           ` Xin Li
  0 siblings, 0 replies; 7+ messages in thread
From: Xin Li @ 2019-05-29 21:26 UTC (permalink / raw)
  To: gitster, jrnieder, git; +Cc: Xin Li

Signed-off-by: Xin Li <delphij@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c  |  2 +-
 t/t5601-clone.sh | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 50bde99618..822208a346 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1215,7 +1215,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			remote_head_points_at, &branch_top);
 
 	if (filter_options.choice)
-		partial_clone_register("origin", &filter_options);
+		partial_clone_register(option_origin, &filter_options);
 
 	if (is_local)
 		clone_local(path, git_dir);
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index d6948cbdab..1fae8ae223 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -634,9 +634,8 @@ test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
 	test_i18ngrep "the following paths have collided" icasefs/warning
 '
 
-partial_clone () {
+partial_clone_server () {
 	       SERVER="$1" &&
-	       URL="$2" &&
 
 	rm -rf "$SERVER" client &&
 	test_create_repo "$SERVER" &&
@@ -646,8 +645,14 @@ partial_clone () {
 	test_commit -C "$SERVER" two &&
 	HASH2=$(git hash-object "$SERVER/two.t") &&
 	test_config -C "$SERVER" uploadpack.allowfilter 1 &&
-	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1 &&
+	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1
+}
 
+partial_clone () {
+	       SERVER="$1" &&
+	       URL="$2" &&
+
+	partial_clone_server "${SERVER}" &&
 	git clone --filter=blob:limit=0 "$URL" client &&
 
 	git -C client fsck &&
@@ -664,6 +669,11 @@ test_expect_success 'partial clone' '
 	partial_clone server "file://$(pwd)/server"
 '
 
+test_expect_success 'partial clone with -o' '
+	partial_clone_server server &&
+	git clone -o blah --filter=blob:limit=0 "file://$(pwd)/server" client
+'
+
 test_expect_success 'partial clone: warn if server does not support object filtering' '
 	rm -rf server client &&
 	test_create_repo server &&
-- 
2.22.0.rc1.257.g3120a18244-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-29 21:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 23:55 [PATCH] Use user supplied origin name for extension.partialcone instead of hardcoded value Xin Li
2019-05-24  0:01 ` Jonathan Nieder
2019-05-24  0:15   ` [PATCH] clone: respect user supplied origin name when setting up partial clone Xin Li
2019-05-29 19:59     ` Junio C Hamano
2019-05-29 21:16       ` [PATCH v3] " Xin Li
2019-05-29 21:22         ` [PATCH v4] " Xin Li
2019-05-29 21:26           ` [PATCH v5] " Xin Li

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git