Re: [PATCH v2] upload-pack: Fail if cloning empty namespace

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2] upload-pack: Fail if cloning empty namespace

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:19

Johannes Löthberg [off-list ref] writes:
On 13/06, Johannes Löthberg wrote:
quoted
Git should fail to clone if trying to clone from an non-existing
ref namespace, since it's the same as a non-existing repository

Signed-off-by: Johannes Löthberg <redacted>
---

Changes since v1:

* Fixed the namespace check, since I apparently forgot to check with a
 bare repo in my last test. D'oh.

Two other options for this would be to either add a
get_git_namespace_len() function and use that, or a is_namespaced()
functon. But since it's only used here for now at least it feels simpler
to not bloat the codabase with another function which has no other use.
I should note that I have a small test script written now, ready to be
converted into a git test, though I want some opinions on whether the
patch would be merged before bothering to convert it.
You would probably want new tests, but more importantly did you make
sure this passes existing tests?  It seems to break 5509 (there
could be others) at least for me.

Re: [PATCH v2] upload-pack: Fail if cloning empty namespace

From: Johannes Löthberg <hidden>
Date: 2016-06-15 23:05:25

On 15/06, Junio C Hamano wrote:
You would probably want new tests, but more importantly did you make
sure this passes existing tests?  It seems to break 5509 (there
could be others) at least for me.
It breaks 5509 currently yeah, though I've already fixed it locally.

Anyway,

You create a namespace by pushing to it, and without a HEAD the 
namespace is not a proper repo, and the code won't deal with them 
properly.  (Which is why without that patch this patch is useless.)

So, if you don't want HEAD to be created when pushing to a ref 
namespace, (which seems to be what you're leaning toward, considering 
your last reply to the other thread,) then ref namespaces won't really 
work in most cases, and it seems pointless to support them at all.

-- 
Sincerely,
  Johannes Löthberg
  PGP Key ID: 0x50FB9B273A9D0BB5
  https://theos.kyriasis.com/~kyrias/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help