Skip to content

Commit 58e60dd

Browse files
Nick HengeveldJunio C Hamano
authored andcommitted
Add support for pushing to a remote repository using HTTP/DAV
Add support for pushing to a remote repository using HTTP/DAV Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 9e5d2b4 commit 58e60dd

File tree

3 files changed

+1725
-2
lines changed

3 files changed

+1725
-2
lines changed

Documentation/git-http-push.txt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
git-http-push(1)
2+
================
3+
4+
NAME
5+
----
6+
git-http-push - Push missing objects using HTTP/DAV.
7+
8+
9+
SYNOPSIS
10+
--------
11+
'git-http-push' [--complete] [--force] [--verbose] <url> <ref> [<ref>...]
12+
13+
DESCRIPTION
14+
-----------
15+
Sends missing objects to remote repository, and updates the
16+
remote branch.
17+
18+
19+
OPTIONS
20+
-------
21+
--complete::
22+
Do not assume that the remote repository is complete in its
23+
current state, and verify all objects in the entire local
24+
ref's history exist in the remote repository.
25+
26+
--force::
27+
Usually, the command refuses to update a remote ref that
28+
is not an ancestor of the local ref used to overwrite it.
29+
This flag disables the check. What this means is that
30+
the remote repository can lose commits; use it with
31+
care.
32+
33+
--verbose::
34+
Report the list of objects being walked locally and the
35+
list of objects successfully sent to the remote repository.
36+
37+
<ref>...:
38+
The remote refs to update.
39+
40+
41+
Specifying the Refs
42+
-------------------
43+
44+
A '<ref>' specification can be either a single pattern, or a pair
45+
of such patterns separated by a colon ":" (this means that a ref name
46+
cannot have a colon in it). A single pattern '<name>' is just a
47+
shorthand for '<name>:<name>'.
48+
49+
Each pattern pair consists of the source side (before the colon)
50+
and the destination side (after the colon). The ref to be
51+
pushed is determined by finding a match that matches the source
52+
side, and where it is pushed is determined by using the
53+
destination side.
54+
55+
- It is an error if <src> does not match exactly one of the
56+
local refs.
57+
58+
- If <dst> does not match any remote ref, either
59+
60+
* it has to start with "refs/"; <dst> is used as the
61+
destination literally in this case.
62+
63+
* <src> == <dst> and the ref that matched the <src> must not
64+
exist in the set of remote refs; the ref matched <src>
65+
locally is used as the name of the destination.
66+
67+
Without '--force', the <src> ref is stored at the remote only if
68+
<dst> does not exist, or <dst> is a proper subset (i.e. an
69+
ancestor) of <src>. This check, known as "fast forward check",
70+
is performed in order to avoid accidentally overwriting the
71+
remote ref and lose other peoples' commits from there.
72+
73+
With '--force', the fast forward check is disabled for all refs.
74+
75+
Optionally, a <ref> parameter can be prefixed with a plus '+' sign
76+
to disable the fast-forward check only on that ref.
77+
78+
79+
Author
80+
------
81+
Written by Nick Hengeveld <nickh@reactrix.com>
82+
83+
Documentation
84+
--------------
85+
Documentation by Nick Hengeveld
86+
87+
GIT
88+
---
89+
Part of the gitlink:git[7] suite

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
# Define NO_OPENSSL environment variable if you do not have OpenSSL. You will
77
# miss out git-rev-list --merge-order. This also implies MOZILLA_SHA1.
88
#
9-
# Define NO_CURL if you do not have curl installed. git-http-pull is not
10-
# built, and you cannot use http:// and https:// transports.
9+
# Define NO_CURL if you do not have curl installed. git-http-pull and
10+
# git-http-push are not built, and you cannot use http:// and https://
11+
# transports.
1112
#
1213
# Define CURLDIR=/foo/bar if your curl header and library files are in
1314
# /foo/bar/include and /foo/bar/lib directories.
1415
#
16+
# Define NO_EXPAT if you do not have expat installed. git-http-push is
17+
# not built, and you cannot push using http:// and https:// transports.
18+
#
1519
# Define NO_STRCASESTR if you don't have strcasestr.
1620
#
1721
# Define PPC_SHA1 environment variable when running make to make use of
@@ -223,6 +227,10 @@ ifndef NO_CURL
223227
CURL_LIBCURL = -lcurl
224228
endif
225229
PROGRAMS += git-http-fetch$X
230+
ifndef NO_EXPAT
231+
EXPAT_LIBEXPAT = -lexpat
232+
PROGRAMS += git-http-push$X
233+
endif
226234
endif
227235

228236
ifndef SHELL_PATH
@@ -375,6 +383,7 @@ git-ssh-pull$X: rsh.o fetch.o
375383
git-ssh-push$X: rsh.o
376384

377385
git-http-fetch$X: LIBS += $(CURL_LIBCURL)
386+
git-http-push$X: LIBS += $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
378387
git-rev-list$X: LIBS += $(OPENSSL_LIBSSL)
379388

380389
init-db.o: init-db.c

0 commit comments

Comments
 (0)