Skip to contentSkip to conversation

http-push: Make WebDAV work with (broken?) default apache2 WebDAV module

PATCH In review Rutger Nijlunsing 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 http-push: Make WebDAV work with (broken?) default apache2 WebDAV module

WebDAV on Debian unstable cannot handle renames on WebDAV from file.ext to newfile (without ext) when newfile* already exists. Normally, git creates a file like 'objects/xx/sha1.token', which is renamed to 'objects/xx/sha1' when transferred completely.

Just use '_' instead of '.' so WebDAV doesn't see it as an extension change.

---
 http-push.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
http-push.c +1 -1
index 4021e7d..d45733e 100644
@@ -530,7 +530,7 @@ static void start_put(struct transfer_re
 	request->dest = xmalloc(strlen(request->url) + 14);
 	sprintf(request->dest, "Destination: %s", request->url);
 	posn += 38;
-	*(posn++) = '.';
+	*(posn++) = '_';
 	strcpy(posn, request->lock->token);
 
 	slot = get_active_slot();
Signature · 7 lines
1.4.2.rc2.g7cb1


-- 
Rutger Nijlunsing ---------------------------------- eludias ed dse.nl
never attribute to a conspiracy which can be explained by incompetence
----------------------------------------------------------------------
#1 lore raw
Quoted 10 lines · Rutger Nijlunsing

WebDAV on Debian unstable cannot handle renames on WebDAV from file.ext to newfile (without ext) when newfile* already exists. Normally, git creates a file like 'objects/xx/sha1.token', which is renamed to 'objects/xx/sha1' when transferred completely.

Just use '_' instead of '.' so WebDAV doesn't see it as an extension change.

Good problem and workaround description. Nick, does this look sane to you, or is there a more kosher way to handle this?

Quoted 25 lines
---
 http-push.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
http-push.c +1 -1
index 4021e7d..d45733e 100644
@@ -530,7 +530,7 @@ static void start_put(struct transfer_re
 	request->dest = xmalloc(strlen(request->url) + 14);
 	sprintf(request->dest, "Destination: %s", request->url);
 	posn += 38;
-	*(posn++) = '.';
+	*(posn++) = '_';
 	strcpy(posn, request->lock->token);
 
 	slot = get_active_slot();
Signature · 7 lines
1.4.2.rc2.g7cb1


-- 
Rutger Nijlunsing ---------------------------------- eludias ed dse.nl
never attribute to a conspiracy which can be explained by incompetence
----------------------------------------------------------------------
#2 lore raw
Quoted 5 lines · Junio C Hamano
Quoted 5 lines

WebDAV on Debian unstable cannot handle renames on WebDAV from file.ext to newfile (without ext) when newfile* already exists. Normally, git creates a file like 'objects/xx/sha1.token', which is renamed to 'objects/xx/sha1' when transferred completely.

Quoted 8 lines
Quoted 5 lines

Just use '_' instead of '.' so WebDAV doesn't see it as an extension change.

Good problem and workaround description. Nick, does this look sane to you, or is there a more kosher way to handle this?

This looks good to me - while it seems like the problem is in the DAV server it also seems like problematic DAV servers will be less likely to trip up on an underscore in the filename.

Signature · 4 lines
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.

This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.