Skip to content

Commit d90a7fd

Browse files
committed
Merge branch 'db/fetch-pack'
* db/fetch-pack: (60 commits) Define compat version of mkdtemp for systems lacking it Avoid scary errors about tagged trees/blobs during git-fetch fetch: if not fetching from default remote, ignore default merge Support 'push --dry-run' for http transport Support 'push --dry-run' for rsync transport Fix 'push --all branch...' error handling Fix compilation when NO_CURL is defined Added a test for fetching remote tags when there is not tags. Fix a crash in ls-remote when refspec expands into nothing Remove duplicate ref matches in fetch Restore default verbosity for http fetches. fetch/push: readd rsync support Introduce remove_dir_recursively() bundle transport: fix an alloc_ref() call Allow abbreviations in the first refspec to be merged Prevent send-pack from segfaulting when a branch doesn't match Cleanup unnecessary break in remote.c Cleanup style nit of 'x == NULL' in remote.c Fix memory leaks when disconnecting transport instances Ensure builtin-fetch honors {fetch,transfer}.unpackLimit ...
2 parents 2db9b49 + ca5bb5d commit d90a7fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2953
-1575
lines changed

Documentation/config.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,11 @@ branch.<name>.remote::
324324
If this option is not given, `git fetch` defaults to remote "origin".
325325

326326
branch.<name>.merge::
327-
When in branch <name>, it tells `git fetch` the default refspec to
328-
be marked for merging in FETCH_HEAD. The value has exactly to match
329-
a remote part of one of the refspecs which are fetched from the remote
330-
given by "branch.<name>.remote".
327+
When in branch <name>, it tells `git fetch` the default
328+
refspec to be marked for merging in FETCH_HEAD. The value is
329+
handled like the remote part of a refspec, and must match a
330+
ref which is fetched from the remote given by
331+
"branch.<name>.remote".
331332
The merge information is used by `git pull` (which at first calls
332333
`git fetch`) to lookup the default branch for merging. Without
333334
this option, `git pull` defaults to merge the first refspec fetched.

Documentation/git-http-push.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-http-push - Push objects over HTTP/DAV to another repository
88

99
SYNOPSIS
1010
--------
11-
'git-http-push' [--all] [--force] [--verbose] <url> <ref> [<ref>...]
11+
'git-http-push' [--all] [--dry-run] [--force] [--verbose] <url> <ref> [<ref>...]
1212

1313
DESCRIPTION
1414
-----------
@@ -30,6 +30,9 @@ OPTIONS
3030
the remote repository can lose commits; use it with
3131
care.
3232

33+
--dry-run::
34+
Do everything except actually send the updates.
35+
3336
--verbose::
3437
Report the list of objects being walked locally and the
3538
list of objects successfully sent to the remote repository.

Makefile

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ all::
3838
#
3939
# Define NO_SETENV if you don't have setenv in the C library.
4040
#
41+
# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
42+
#
4143
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
4244
# Enable it on Windows. By default, symrefs are still used.
4345
#
@@ -208,7 +210,6 @@ BASIC_LDFLAGS =
208210
SCRIPT_SH = \
209211
git-bisect.sh git-checkout.sh \
210212
git-clean.sh git-clone.sh git-commit.sh \
211-
git-fetch.sh \
212213
git-ls-remote.sh \
213214
git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \
214215
git-pull.sh git-rebase.sh git-rebase--interactive.sh \
@@ -235,14 +236,14 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
235236
# ... and all the rest that could be moved out of bindir to gitexecdir
236237
PROGRAMS = \
237238
git-fetch-pack$X \
238-
git-hash-object$X git-index-pack$X git-local-fetch$X \
239+
git-hash-object$X git-index-pack$X \
239240
git-fast-import$X \
240241
git-daemon$X \
241242
git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
242243
git-peek-remote$X git-receive-pack$X \
243244
git-send-pack$X git-shell$X \
244-
git-show-index$X git-ssh-fetch$X \
245-
git-ssh-upload$X git-unpack-file$X \
245+
git-show-index$X \
246+
git-unpack-file$X \
246247
git-update-server-info$X \
247248
git-upload-pack$X \
248249
git-pack-redundant$X git-var$X \
@@ -270,9 +271,6 @@ ifndef NO_TCLTK
270271
OTHER_PROGRAMS += gitk-wish
271272
endif
272273

273-
# Backward compatibility -- to be removed after 1.0
274-
PROGRAMS += git-ssh-pull$X git-ssh-push$X
275-
276274
# Set paths to tools early so that they can be used for version tests.
277275
ifndef SHELL_PATH
278276
SHELL_PATH = /bin/sh
@@ -292,7 +290,7 @@ LIB_H = \
292290
run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
293291
tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \
294292
utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \
295-
mailmap.h remote.h
293+
mailmap.h remote.h transport.h
296294

297295
DIFF_OBJS = \
298296
diff.o diff-lib.o diffcore-break.o diffcore-order.o \
@@ -314,7 +312,8 @@ LIB_OBJS = \
314312
write_or_die.o trace.o list-objects.o grep.o match-trees.o \
315313
alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \
316314
color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \
317-
convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o
315+
convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o \
316+
transport.o bundle.o walker.o
318317

319318
BUILTIN_OBJS = \
320319
builtin-add.o \
@@ -335,6 +334,8 @@ BUILTIN_OBJS = \
335334
builtin-diff-files.o \
336335
builtin-diff-index.o \
337336
builtin-diff-tree.o \
337+
builtin-fetch.o \
338+
builtin-fetch-pack.o \
338339
builtin-fetch--tool.o \
339340
builtin-fmt-merge-msg.o \
340341
builtin-for-each-ref.o \
@@ -416,12 +417,14 @@ ifeq ($(uname_S),SunOS)
416417
NEEDS_LIBICONV = YesPlease
417418
NO_UNSETENV = YesPlease
418419
NO_SETENV = YesPlease
420+
NO_MKDTEMP = YesPlease
419421
NO_C99_FORMAT = YesPlease
420422
NO_STRTOUMAX = YesPlease
421423
endif
422424
ifeq ($(uname_R),5.9)
423425
NO_UNSETENV = YesPlease
424426
NO_SETENV = YesPlease
427+
NO_MKDTEMP = YesPlease
425428
NO_C99_FORMAT = YesPlease
426429
NO_STRTOUMAX = YesPlease
427430
endif
@@ -518,15 +521,19 @@ else
518521
CC_LD_DYNPATH = -R
519522
endif
520523

521-
ifndef NO_CURL
524+
ifdef NO_CURL
525+
BASIC_CFLAGS += -DNO_CURL
526+
else
522527
ifdef CURLDIR
523528
# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
524529
BASIC_CFLAGS += -I$(CURLDIR)/include
525530
CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
526531
else
527532
CURL_LIBCURL = -lcurl
528533
endif
529-
PROGRAMS += git-http-fetch$X
534+
BUILTIN_OBJS += builtin-http-fetch.o
535+
EXTLIBS += $(CURL_LIBCURL)
536+
LIB_OBJS += http.o http-walker.o
530537
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
531538
ifeq "$(curl_check)" "070908"
532539
ifndef NO_EXPAT
@@ -608,6 +615,10 @@ ifdef NO_SETENV
608615
COMPAT_CFLAGS += -DNO_SETENV
609616
COMPAT_OBJS += compat/setenv.o
610617
endif
618+
ifdef NO_MKDTEMP
619+
COMPAT_CFLAGS += -DNO_MKDTEMP
620+
COMPAT_OBJS += compat/mkdtemp.o
621+
endif
611622
ifdef NO_UNSETENV
612623
COMPAT_CFLAGS += -DNO_UNSETENV
613624
COMPAT_OBJS += compat/unsetenv.o
@@ -889,33 +900,22 @@ http.o: http.c GIT-CFLAGS
889900
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $<
890901

891902
ifdef NO_EXPAT
892-
http-fetch.o: http-fetch.c http.h GIT-CFLAGS
903+
http-walker.o: http-walker.c http.h GIT-CFLAGS
893904
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<
894905
endif
895906

896907
git-%$X: %.o $(GITLIBS)
897908
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
898909

899-
ssh-pull.o: ssh-fetch.c
900-
ssh-push.o: ssh-upload.c
901-
git-local-fetch$X: fetch.o
902-
git-ssh-fetch$X: rsh.o fetch.o
903-
git-ssh-upload$X: rsh.o
904-
git-ssh-pull$X: rsh.o fetch.o
905-
git-ssh-push$X: rsh.o
906-
907910
git-imap-send$X: imap-send.o $(LIB_FILE)
908911

909-
http.o http-fetch.o http-push.o: http.h
910-
git-http-fetch$X: fetch.o http.o http-fetch.o $(GITLIBS)
911-
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
912-
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
912+
http.o http-walker.o http-push.o: http.h
913913

914914
git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
915915
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
916916
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
917917

918-
$(LIB_OBJS) $(BUILTIN_OBJS) fetch.o: $(LIB_H)
918+
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
919919
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
920920
$(DIFF_OBJS): diffcore.h
921921

@@ -1131,8 +1131,7 @@ check-docs::
11311131
git-merge-octopus | git-merge-ours | git-merge-recursive | \
11321132
git-merge-resolve | git-merge-stupid | \
11331133
git-add--interactive | git-fsck-objects | git-init-db | \
1134-
git-repo-config | git-fetch--tool | \
1135-
git-ssh-pull | git-ssh-push ) continue ;; \
1134+
git-repo-config | git-fetch--tool ) continue ;; \
11361135
esac ; \
11371136
test -f "Documentation/$$v.txt" || \
11381137
echo "no doc: $$v"; \

0 commit comments

Comments
 (0)