Skip to content

Commit b888d61

Browse files
iabervongitster
authored andcommitted
Make fetch a builtin
Thanks to Johannes Schindelin for review and fixes, and Julian Phillips for the original C translation. This changes a few small bits of behavior: branch.<name>.merge is parsed as if it were the lhs of a fetch refspec, and does not have to exactly match the actual lhs of a refspec, so long as it is a valid abbreviation for the same ref. branch.<name>.merge is no longer ignored if the remote is configured with a branches/* file. Neither behavior is useful, because there can only be one ref that gets fetched, but this is more consistant. Also, fetch prints different information to standard out. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c7a8a16 commit b888d61

17 files changed

+571
-15
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.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ BASIC_LDFLAGS =
207207
SCRIPT_SH = \
208208
git-bisect.sh git-checkout.sh \
209209
git-clean.sh git-clone.sh git-commit.sh \
210-
git-fetch.sh \
211210
git-ls-remote.sh \
212211
git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \
213212
git-pull.sh git-rebase.sh git-rebase--interactive.sh \
@@ -332,6 +331,7 @@ BUILTIN_OBJS = \
332331
builtin-diff-files.o \
333332
builtin-diff-index.o \
334333
builtin-diff-tree.o \
334+
builtin-fetch.o \
335335
builtin-fetch-pack.o \
336336
builtin-fetch--tool.o \
337337
builtin-fmt-merge-msg.o \

0 commit comments

Comments
 (0)