Skip to content

Commit 8042ed1

Browse files
author
Junio C Hamano
committed
Merge branch 'master' into js/merge
* master: (42 commits) git-svn: correctly handle packed-refs in refs/remotes/ add test case for recursive merge git-svn: correctly display fatal() error messages git-svn: allow dcommit to take an alternate head git-svn: enable logging of information not supported by git Clarify fetch error for missing objects. Move Fink and Ports check to after config file shortlog: fix segfault on empty authorname shortlog: remove "[PATCH]" prefix from shortlog output Make sure the empty tree exists when needed in merge-recursive. Don't use memcpy when source and dest. buffers may overlap no need to install manpages as executable Documentation: simpler shared repository creation shortlog: fix segfault on empty authorname Add branch.*.merge warning and documentation update Fix perl/ build. git-svn: use do_switch for --follow-parent if the SVN library supports it Fix documentation copy&paste typo git-svn: extra error check to ensure we open a file correctly Documentation: update git-clone man page with new behavior ...
2 parents e2b7008 + c53d696 commit 8042ed1

31 files changed

+675
-363
lines changed

Documentation/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ man7: $(DOC_MAN7)
5656

5757
install: man
5858
$(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir)
59-
$(INSTALL) $(DOC_MAN1) $(DESTDIR)$(man1dir)
60-
$(INSTALL) $(DOC_MAN7) $(DESTDIR)$(man7dir)
59+
$(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
60+
$(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
6161

6262

6363
#

Documentation/config.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,17 @@ apply.whitespace::
125125

126126
branch.<name>.remote::
127127
When in branch <name>, it tells `git fetch` which remote to fetch.
128+
If this option is not given, `git fetch` defaults to remote "origin".
128129

129130
branch.<name>.merge::
130-
When in branch <name>, it tells `git fetch` the default remote branch
131-
to be merged.
131+
When in branch <name>, it tells `git fetch` the default refspec to
132+
be marked for merging in FETCH_HEAD. The value has exactly to match
133+
a remote part of one of the refspecs which are fetched from the remote
134+
given by "branch.<name>.remote".
135+
The merge information is used by `git pull` (which at first calls
136+
`git fetch`) to lookup the default branch for merging. Without
137+
this option, `git pull` defaults to merge the first refspec fetched.
138+
Specify multiple values to get an octopus merge.
132139

133140
pager.color::
134141
A boolean to enable/disable colored output when the pager is in

Documentation/cvs-migration.txt

Lines changed: 111 additions & 241 deletions
Large diffs are not rendered by default.

Documentation/diff-options.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,21 @@
129129
-a::
130130
Shorthand for "--text".
131131

132+
--ignore-space-change::
133+
Ignore changes in amount of white space. This ignores white
134+
space at line end, and consider all other sequences of one or
135+
more white space characters to be equivalent.
136+
137+
-b::
138+
Shorthand for "--ignore-space-change".
139+
140+
--ignore-all-space::
141+
Ignore white space when comparing lines. This ignores
142+
difference even if one line has white space where the other
143+
line has none.
144+
145+
-w::
146+
Shorthand for "--ignore-all-space".
147+
132148
For more detailed explanation on these common options, see also
133149
link:diffcore.html[diffcore documentation].

Documentation/git-clone.txt

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,26 @@ SYNOPSIS
1111
[verse]
1212
'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
1313
[-o <name>] [-u <upload-pack>] [--reference <repository>]
14-
[--use-separate-remote | --use-immingled-remote] <repository>
14+
[--use-separate-remote | --no-separate-remote] <repository>
1515
[<directory>]
1616

1717
DESCRIPTION
1818
-----------
19-
Clones a repository into a newly created directory. All remote
20-
branch heads are copied under `$GIT_DIR/refs/heads/`, except
21-
that the remote `master` is also copied to `origin` branch.
2219

23-
In addition, `$GIT_DIR/remotes/origin` file is set up to have
24-
this line:
20+
Clones a repository into a newly created directory, creates
21+
remote-tracking branches for each branch in the cloned repository
22+
(visible using `git branch -r`), and creates and checks out a master
23+
branch equal to the cloned repository's master branch.
2524

26-
Pull: master:origin
27-
28-
This is to help the typical workflow of working off of the
29-
remote `master` branch. Every time `git pull` without argument
30-
is run, the progress on the remote `master` branch is tracked by
31-
copying it into the local `origin` branch, and merged into the
32-
branch you are currently working on. Remote branches other than
33-
`master` are also added there to be tracked.
25+
After the clone, a plain `git fetch` without arguments will update
26+
all the remote-tracking branches, and a `git pull` without
27+
arguments will in addition merge the remote master branch into the
28+
current branch.
3429

30+
This default configuration is achieved by creating references to
31+
the remote branch heads under `$GIT_DIR/refs/remotes/origin` and
32+
by initializing `remote.origin.url` and `remote.origin.fetch`
33+
configuration variables.
3534

3635
OPTIONS
3736
-------
@@ -105,7 +104,7 @@ OPTIONS
105104
of `$GIT_DIR/refs/heads/`. Only the local master branch is
106105
saved in the latter. This is the default.
107106

108-
--use-immingled-remote::
107+
--no-separate-remote::
109108
Save remotes heads in the same namespace as the local
110109
heads, `$GIT_DIR/refs/heads/'. In regular repositories,
111110
this is a legacy setup git-clone created by default in

Documentation/git-svn.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ See '<<fetch-args,Additional Fetch Arguments>>' if you are interested in
5757
manually joining branches on commit.
5858

5959
'dcommit'::
60-
Commit all diffs from the current HEAD directly to the SVN
60+
Commit all diffs from a specified head directly to the SVN
6161
repository, and then rebase or reset (depending on whether or
62-
not there is a diff between SVN and HEAD). It is recommended
62+
not there is a diff between SVN and head). It is recommended
6363
that you run git-svn fetch and rebase (not pull) your commits
6464
against the latest changes in the SVN repository.
65+
An optional command-line argument may be specified as an
66+
alternative to HEAD.
6567
This is advantageous over 'commit' (below) because it produces
6668
cleaner, more linear history.
6769

Makefile

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ all:
9191
#
9292
# Define USE_STDEV below if you want git to care about the underlying device
9393
# change being considered an inode change from the update-cache perspective.
94+
#
95+
# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
96+
# MakeMaker (e.g. using ActiveState under Cygwin).
97+
#
9498

9599
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
96100
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -323,18 +327,6 @@ ifeq ($(uname_S),Darwin)
323327
NEEDS_SSL_WITH_CRYPTO = YesPlease
324328
NEEDS_LIBICONV = YesPlease
325329
NO_STRLCPY = YesPlease
326-
ifndef NO_FINK
327-
ifeq ($(shell test -d /sw/lib && echo y),y)
328-
BASIC_CFLAGS += -I/sw/include
329-
BASIC_LDFLAGS += -L/sw/lib
330-
endif
331-
endif
332-
ifndef NO_DARWIN_PORTS
333-
ifeq ($(shell test -d /opt/local/lib && echo y),y)
334-
BASIC_CFLAGS += -I/opt/local/include
335-
BASIC_LDFLAGS += -L/opt/local/lib
336-
endif
337-
endif
338330
endif
339331
ifeq ($(uname_S),SunOS)
340332
NEEDS_SOCKET = YesPlease
@@ -412,6 +404,21 @@ endif
412404
-include config.mak.autogen
413405
-include config.mak
414406

407+
ifeq ($(uname_S),Darwin)
408+
ifndef NO_FINK
409+
ifeq ($(shell test -d /sw/lib && echo y),y)
410+
BASIC_CFLAGS += -I/sw/include
411+
BASIC_LDFLAGS += -L/sw/lib
412+
endif
413+
endif
414+
ifndef NO_DARWIN_PORTS
415+
ifeq ($(shell test -d /opt/local/lib && echo y),y)
416+
BASIC_CFLAGS += -I/opt/local/include
417+
BASIC_LDFLAGS += -L/opt/local/lib
418+
endif
419+
endif
420+
endif
421+
415422
ifndef NO_CURL
416423
ifdef CURLDIR
417424
# This is still problematic -- gcc does not always want -R.
@@ -540,6 +547,9 @@ endif
540547
ifdef NO_ACCURATE_DIFF
541548
BASIC_CFLAGS += -DNO_ACCURATE_DIFF
542549
endif
550+
ifdef NO_PERL_MAKEMAKER
551+
export NO_PERL_MAKEMAKER
552+
endif
543553

544554
# Shell quote (do not use $(call) to accommodate ancient setups);
545555

@@ -569,8 +579,8 @@ export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
569579

570580
all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
571581

572-
all: perl/Makefile
573-
$(MAKE) -C perl
582+
all:
583+
$(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
574584
$(MAKE) -C templates
575585

576586
strip: $(PROGRAMS) git$X
@@ -603,7 +613,11 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
603613
chmod +x $@+
604614
mv $@+ $@
605615

606-
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/Makefile
616+
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
617+
618+
perl/perl.mak: GIT-CFLAGS
619+
$(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
620+
607621
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
608622
rm -f $@ $@+
609623
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
@@ -798,7 +812,7 @@ install: all
798812
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
799813
$(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)'
800814
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
801-
$(MAKE) -C perl install
815+
$(MAKE) -C perl prefix='$(prefix_SQ)' install
802816
if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
803817
then \
804818
ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
@@ -868,8 +882,7 @@ clean:
868882
rm -f $(htmldocs).tar.gz $(manpages).tar.gz
869883
rm -f gitweb/gitweb.cgi
870884
$(MAKE) -C Documentation/ clean
871-
[ ! -f perl/Makefile ] || $(MAKE) -C perl/ clean || $(MAKE) -C perl/ clean
872-
rm -f perl/ppport.h perl/Makefile.old
885+
$(MAKE) -C perl clean
873886
$(MAKE) -C templates/ clean
874887
$(MAKE) -C t/ clean
875888
rm -f GIT-VERSION-FILE GIT-CFLAGS

builtin-mv.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,24 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
146146
&& lstat(dst, &st) == 0)
147147
bad = "cannot move directory over file";
148148
else if (src_is_dir) {
149+
const char *src_w_slash = add_slash(src);
150+
int len_w_slash = length + 1;
149151
int first, last;
150152

151153
modes[i] = WORKING_DIRECTORY;
152154

153-
first = cache_name_pos(src, length);
155+
first = cache_name_pos(src_w_slash, len_w_slash);
154156
if (first >= 0)
155-
die ("Huh? %s/ is in index?", src);
157+
die ("Huh? %.*s is in index?",
158+
len_w_slash, src_w_slash);
156159

157160
first = -1 - first;
158161
for (last = first; last < active_nr; last++) {
159162
const char *path = active_cache[last]->name;
160-
if (strncmp(path, src, length)
161-
|| path[length] != '/')
163+
if (strncmp(path, src_w_slash, len_w_slash))
162164
break;
163165
}
166+
free((char *)src_w_slash);
164167

165168
if (last - first < 1)
166169
bad = "source directory is empty";

builtin-shortlog.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,25 @@ static void read_from_stdin(struct path_list *list)
188188
bob = buffer + strlen(buffer);
189189
else {
190190
offset = 8;
191-
while (isspace(bob[-1]))
191+
while (buffer + offset < bob &&
192+
isspace(bob[-1]))
192193
bob--;
193194
}
194195

195196
while (fgets(buffer2, sizeof(buffer2), stdin) &&
196197
buffer2[0] != '\n')
197198
; /* chomp input */
198-
if (fgets(buffer2, sizeof(buffer2), stdin))
199+
if (fgets(buffer2, sizeof(buffer2), stdin)) {
200+
int l2 = strlen(buffer2);
201+
int i;
202+
for (i = 0; i < l2; i++)
203+
if (!isspace(buffer2[i]))
204+
break;
199205
insert_author_oneline(list,
200206
buffer + offset,
201207
bob - buffer - offset,
202-
buffer2, strlen(buffer2));
208+
buffer2 + i, l2 - i);
209+
}
203210
}
204211
}
205212
}
@@ -236,7 +243,7 @@ static void get_from_rev(struct rev_info *rev, struct path_list *list)
236243
author = scratch;
237244
authorlen = strlen(scratch);
238245
} else {
239-
while (bracket[-1] == ' ')
246+
if (bracket[-1] == ' ')
240247
bracket--;
241248

242249
author = buffer + 7;

fetch.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ void pull_say(const char *fmt, const char *hex)
2222
fprintf(stderr, fmt, hex);
2323
}
2424

25-
static void report_missing(const char *what, const unsigned char *missing)
25+
static void report_missing(const struct object *obj)
2626
{
2727
char missing_hex[41];
28-
29-
strcpy(missing_hex, sha1_to_hex(missing));;
30-
fprintf(stderr,
31-
"Cannot obtain needed %s %s\nwhile processing commit %s.\n",
32-
what, missing_hex, sha1_to_hex(current_commit_sha1));
28+
strcpy(missing_hex, sha1_to_hex(obj->sha1));;
29+
fprintf(stderr, "Cannot obtain needed %s %s\n",
30+
obj->type ? typename(obj->type): "object", missing_hex);
31+
if (!is_null_sha1(current_commit_sha1))
32+
fprintf(stderr, "while processing commit %s.\n",
33+
sha1_to_hex(current_commit_sha1));
3334
}
3435

3536
static int process(struct object *obj);
@@ -177,7 +178,7 @@ static int loop(void)
177178
*/
178179
if (! (obj->flags & TO_SCAN)) {
179180
if (fetch(obj->sha1)) {
180-
report_missing(typename(obj->type), obj->sha1);
181+
report_missing(obj);
181182
return -1;
182183
}
183184
}

0 commit comments

Comments
 (0)