Skip to content

Commit 79a9d8e

Browse files
author
Peter Anvin
committed
Merge with master.kernel.org:/pub/scm/git/git.git
2 parents 039c6f1 + baaac6a commit 79a9d8e

Some content is hidden

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

44 files changed

+1360
-451
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ git-ssh-push
8282
git-ssh-upload
8383
git-status
8484
git-stripspace
85+
git-symbolic-ref
8586
git-tag
8687
git-tar-tree
8788
git-unpack-file

Documentation/git-clone.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ git-clone - Clones a repository.
99

1010
SYNOPSIS
1111
--------
12-
'git clone' [-l] [-u <upload-pack>] [-q] <repository> <directory>
12+
'git clone' [-l [-s]] [-q] [-n] [-u <upload-pack>] <repository> <directory>
1313

1414
DESCRIPTION
1515
-----------
1616
Clones a repository into a newly created directory.
1717

1818
OPTIONS
1919
-------
20+
--local::
2021
-l::
2122
When the repository to clone from is on a local machine,
2223
this flag bypasses normal "git aware" transport
@@ -25,10 +26,22 @@ OPTIONS
2526
The files under .git/objects/ directory are hardlinked
2627
to save space when possible.
2728

29+
--shared::
30+
-s::
31+
When the repository to clone is on the local machine,
32+
instead of using hard links automatically setup
33+
.git/objects/info/alternatives to share the objects
34+
with the source repository
35+
36+
--quiet::
2837
-q::
2938
Operate quietly. This flag is passed to "rsync" and
3039
"git-clone-pack" commands when given.
3140

41+
-n::
42+
No checkout of HEAD is performed after the clone is complete.
43+
44+
--upload-pack <upload-pack>::
3245
-u <upload-pack>::
3346
When given, and the repository to clone from is handled
3447
by 'git-clone-pack', '--exec=<upload-pack>' is passed to

Documentation/git-ls-files.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SYNOPSIS
1313
(-[c|d|o|i|s|u|k|m])\*
1414
[-x <pattern>|--exclude=<pattern>]
1515
[-X <file>|--exclude-from=<file>]
16-
[--exclude-per-directory=<file>]
16+
[--exclude-per-directory=<file>] [--] [<file>]\*
1717

1818
DESCRIPTION
1919
-----------
@@ -77,6 +77,13 @@ OPTIONS
7777
K to be killed
7878
? other
7979

80+
--::
81+
Do not interpret any more arguments as options.
82+
83+
<file>::
84+
Files to show. If no files are given all files which match the other
85+
specified criteria are shown.
86+
8087
Output
8188
------
8289
show files just outputs the filename unless '--stage' is specified in

Makefile

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
# DEFINES += -DUSE_STDEV
5252

53-
GIT_VERSION = 0.99.7.GIT
53+
GIT_VERSION = 0.99.8.GIT
5454

5555
CFLAGS = -g -O2 -Wall
5656
ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
@@ -103,25 +103,29 @@ SIMPLE_PROGRAMS = \
103103

104104
# ... and all the rest
105105
PROGRAMS = \
106-
git-apply$X git-cat-file$X git-checkout-index$X \
107-
git-clone-pack$X git-commit-tree$X git-convert-objects$X \
108-
git-diff-files$X git-diff-index$X git-diff-stages$X \
109-
git-diff-tree$X git-fetch-pack$X git-fsck-objects$X \
110-
git-hash-object$X git-init-db$X git-local-fetch$X \
111-
git-ls-files$X git-ls-tree$X git-merge-base$X \
112-
git-merge-index$X git-mktag$X git-pack-objects$X \
113-
git-patch-id$X git-peek-remote$X git-prune-packed$X \
114-
git-read-tree$X git-receive-pack$X git-rev-list$X \
115-
git-rev-parse$X git-send-pack$X git-show-branch$X \
116-
git-show-index$X git-ssh-fetch$X git-ssh-upload$X \
117-
git-tar-tree$X git-unpack-file$X git-unpack-objects$X \
118-
git-update-index$X git-update-server-info$X \
119-
git-upload-pack$X git-verify-pack$X git-write-tree$X \
120-
git-update-ref$X $(SIMPLE_PROGRAMS)
106+
git-apply$X git-cat-file$X \
107+
git-checkout-index$X git-clone-pack$X git-commit-tree$X \
108+
git-convert-objects$X git-diff-files$X \
109+
git-diff-index$X git-diff-stages$X \
110+
git-diff-tree$X git-fetch-pack$X git-fsck-objects$X \
111+
git-hash-object$X git-init-db$X \
112+
git-local-fetch$X git-ls-files$X git-ls-tree$X git-merge-base$X \
113+
git-merge-index$X git-mktag$X git-pack-objects$X git-patch-id$X \
114+
git-peek-remote$X git-prune-packed$X git-read-tree$X \
115+
git-receive-pack$X git-rev-list$X git-rev-parse$X \
116+
git-send-pack$X git-show-branch$X \
117+
git-show-index$X git-ssh-fetch$X \
118+
git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
119+
git-unpack-objects$X git-update-index$X git-update-server-info$X \
120+
git-upload-pack$X git-verify-pack$X git-write-tree$X \
121+
git-update-ref$X git-symbolic-ref$X \
122+
$(SIMPLE_PROGRAMS)
121123

122124
# Backward compatibility -- to be removed after 1.0
123125
PROGRAMS += git-ssh-pull$X git-ssh-push$X
124126

127+
GIT_LIST_TWEAK =
128+
125129
PYMODULES = \
126130
gitMergeCommon.py
127131

@@ -131,6 +135,8 @@ endif
131135

132136
ifdef WITH_SEND_EMAIL
133137
SCRIPT_PERL += git-send-email.perl
138+
else
139+
GIT_LIST_TWEAK += -e '/^send-email$$/d'
134140
endif
135141

136142
LIB_FILE=libgit.a
@@ -181,6 +187,10 @@ endif
181187
ifneq (,$(findstring arm,$(shell uname -m)))
182188
ARM_SHA1 = YesPlease
183189
endif
190+
ifeq ($(shell uname -s),OpenBSD)
191+
NEEDS_LIBICONV = YesPlease
192+
PLATFORM_DEFINES += -I/usr/local/include -L/usr/local/lib
193+
endif
184194

185195
ifndef NO_CURL
186196
ifdef CURLDIR
@@ -206,18 +216,32 @@ endif
206216
ifndef NO_OPENSSL
207217
LIB_OBJS += epoch.o
208218
OPENSSL_LIBSSL = -lssl
219+
ifdef OPENSSLDIR
220+
# Again this may be problematic -- gcc does not always want -R.
221+
CFLAGS += -I$(OPENSSLDIR)/include
222+
OPENSSL_LINK = -L$(OPENSSLDIR)/lib -R$(OPENSSLDIR)/lib
223+
else
224+
OPENSSL_LINK =
225+
endif
209226
else
210227
DEFINES += '-DNO_OPENSSL'
211228
MOZILLA_SHA1 = 1
212229
OPENSSL_LIBSSL =
213230
endif
214231
ifdef NEEDS_SSL_WITH_CRYPTO
215-
LIB_4_CRYPTO = -lcrypto -lssl
232+
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
216233
else
217-
LIB_4_CRYPTO = -lcrypto
234+
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
218235
endif
219236
ifdef NEEDS_LIBICONV
220-
LIB_4_ICONV = -liconv
237+
ifdef ICONVDIR
238+
# Again this may be problematic -- gcc does not always want -R.
239+
CFLAGS += -I$(ICONVDIR)/include
240+
ICONV_LINK = -L$(ICONVDIR)/lib -R$(ICONVDIR)/lib
241+
else
242+
ICONV_LINK =
243+
endif
244+
LIB_4_ICONV = $(ICONV_LINK) -liconv
221245
else
222246
LIB_4_ICONV =
223247
endif
@@ -273,8 +297,13 @@ all:
273297
git: git.sh Makefile
274298
rm -f $@+ $@
275299
sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
300+
<<<<<<< Makefile
276301
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
277302
-e 's/@@X@@/$(X)/g' <[email protected] >$@+
303+
=======
304+
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
305+
$(GIT_LIST_TWEAK) <[email protected] >$@+
306+
>>>>>>> .merge_file_3QHyD4
278307
chmod +x $@+
279308
mv $@+ $@
280309

apply.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,16 @@ static int parse_single_patch(char *line, unsigned long size, struct patch *patc
723723
return offset;
724724
}
725725

726+
static inline int metadata_changes(struct patch *patch)
727+
{
728+
return patch->is_rename > 0 ||
729+
patch->is_copy > 0 ||
730+
patch->is_new > 0 ||
731+
patch->is_delete ||
732+
(patch->old_mode && patch->new_mode &&
733+
patch->old_mode != patch->new_mode);
734+
}
735+
726736
static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
727737
{
728738
int hdrsize, patchsize;
@@ -733,6 +743,9 @@ static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
733743

734744
patchsize = parse_single_patch(buffer + offset + hdrsize, size - offset - hdrsize, patch);
735745

746+
if (!patchsize && !metadata_changes(patch))
747+
die("patch with only garbage at line %d", linenr);
748+
736749
return offset + hdrsize + patchsize;
737750
}
738751

cache.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)
189189
extern char *sha1_file_name(const unsigned char *sha1);
190190
extern char *sha1_pack_name(const unsigned char *sha1);
191191
extern char *sha1_pack_index_name(const unsigned char *sha1);
192+
extern const unsigned char null_sha1[20];
192193

193194
int git_mkstemp(char *path, size_t n, const char *template);
194195

@@ -228,6 +229,10 @@ extern int has_pack_index(const unsigned char *sha1);
228229
extern int get_sha1(const char *str, unsigned char *sha1);
229230
extern int get_sha1_hex(const char *hex, unsigned char *sha1);
230231
extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
232+
extern int read_ref(const char *filename, unsigned char *sha1);
233+
extern const char *resolve_ref(const char *path, unsigned char *sha1, int);
234+
extern int create_symref(const char *git_HEAD, const char *refs_heads_master);
235+
extern int validate_symref(const char *git_HEAD);
231236

232237
/* General helper functions */
233238
extern void usage(const char *err) NORETURN;

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
git-core (0.99.8-0) unstable; urgency=low
2+
3+
* GIT 0.99.8
4+
5+
-- Junio C Hamano <[email protected]> Sun, 2 Oct 2005 12:54:26 -0700
6+
17
git-core (0.99.7-0) unstable; urgency=low
28

39
* GIT 0.99.7

diff-files.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ static void show_modified(int oldmode, int mode,
3434

3535
int main(int argc, const char **argv)
3636
{
37-
static const unsigned char null_sha1[20] = { 0, };
3837
const char **pathspec;
3938
const char *prefix = setup_git_directory();
4039
int entries, i;

diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "diffcore.h"
1111

1212
static const char *diff_opts = "-pu";
13-
static unsigned char null_sha1[20] = { 0, };
1413

1514
static int use_size_cache;
1615

@@ -414,7 +413,7 @@ void diff_free_filespec_data(struct diff_filespec *s)
414413
static void prep_temp_blob(struct diff_tempfile *temp,
415414
void *blob,
416415
unsigned long size,
417-
unsigned char *sha1,
416+
const unsigned char *sha1,
418417
int mode)
419418
{
420419
int fd;

fsck-objects.c

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -402,25 +402,17 @@ static void fsck_object_dir(const char *path)
402402

403403
static int fsck_head_link(void)
404404
{
405-
int fd, count;
406-
char hex[40];
407405
unsigned char sha1[20];
408-
static char path[PATH_MAX], link[PATH_MAX];
409-
const char *git_dir = get_git_dir();
410-
411-
snprintf(path, sizeof(path), "%s/HEAD", git_dir);
412-
if (readlink(path, link, sizeof(link)) < 0)
413-
return error("HEAD is not a symlink");
414-
if (strncmp("refs/heads/", link, 11))
415-
return error("HEAD points to something strange (%s)", link);
416-
fd = open(path, O_RDONLY);
417-
if (fd < 0)
418-
return error("HEAD: %s", strerror(errno));
419-
count = read(fd, hex, sizeof(hex));
420-
close(fd);
421-
if (count < 0)
422-
return error("HEAD: %s", strerror(errno));
423-
if (count < 40 || get_sha1_hex(hex, sha1))
406+
const char *git_HEAD = strdup(git_path("HEAD"));
407+
const char *git_refs_heads_master = resolve_ref(git_HEAD, sha1, 1);
408+
int pfxlen = strlen(git_HEAD) - 4; /* strip .../.git/ part */
409+
410+
if (!git_refs_heads_master)
411+
return error("HEAD is not a symbolic ref");
412+
if (strncmp(git_refs_heads_master + pfxlen, "refs/heads/", 11))
413+
return error("HEAD points to something strange (%s)",
414+
git_refs_heads_master + pfxlen);
415+
if (!memcmp(null_sha1, sha1, 20))
424416
return error("HEAD: not a valid git pointer");
425417
return 0;
426418
}

git-archimport.perl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ END
228228
# skip commits already in repo
229229
#
230230
if (ptag($ps->{id})) {
231-
$opt_v && print "Skipping already imported: $ps->{id}\n";
231+
$opt_v && print " * Skipping already imported: $ps->{id}\n";
232232
next;
233233
}
234234

235+
print " * Starting to work on $ps->{id}\n";
236+
235237
#
236238
# create the branch if needed
237239
#
@@ -675,6 +677,10 @@ sub find_parents {
675677
# that branch.
676678
#
677679
foreach my $branch (keys %branches) {
680+
681+
# check that we actually know about the branch
682+
next unless -e "$git_dir/refs/heads/$branch";
683+
678684
my $mergebase = `git-merge-base $branch $ps->{branch}`;
679685
die "Cannot find merge base for $branch and $ps->{branch}" if $?;
680686
chomp $mergebase;

git-bisect.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ bisect_start() {
3838
# Verify HEAD. If we were bisecting before this, reset to the
3939
# top-of-line master first!
4040
#
41-
head=$(readlink $GIT_DIR/HEAD) || die "Bad HEAD - I need a symlink"
41+
head=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD) ||
42+
die "Bad HEAD - I need a symbolic ref"
4243
case "$head" in
4344
refs/heads/bisect*)
4445
git checkout master || exit
4546
;;
4647
refs/heads/*)
4748
;;
4849
*)
49-
die "Bad HEAD - strange symlink"
50+
die "Bad HEAD - strange symbolic ref"
5051
;;
5152
esac
5253

@@ -135,7 +136,7 @@ bisect_next() {
135136
echo "$rev" > "$GIT_DIR/refs/heads/new-bisect"
136137
git checkout new-bisect || exit
137138
mv "$GIT_DIR/refs/heads/new-bisect" "$GIT_DIR/refs/heads/bisect" &&
138-
ln -sf refs/heads/bisect "$GIT_DIR/HEAD"
139+
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD refs/heads/bisect
139140
git-show-branch "$rev"
140141
}
141142

git-branch.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ If two arguments, create a new branch <branchname> based off of <start-point>.
1414

1515
delete_branch () {
1616
option="$1" branch_name="$2"
17-
headref=$(readlink "$GIT_DIR/HEAD" | sed -e 's|^refs/heads/||')
17+
headref=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD |
18+
sed -e 's|^refs/heads/||')
1819
case ",$headref," in
1920
",$branch_name,")
2021
die "Cannot delete the branch you are on." ;;
@@ -67,7 +68,8 @@ done
6768

6869
case "$#" in
6970
0)
70-
headref=$(readlink "$GIT_DIR/HEAD" | sed -e 's|^refs/heads/||')
71+
headref=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD |
72+
sed -e 's|^refs/heads/||')
7173
git-rev-parse --symbolic --all |
7274
sed -ne 's|^refs/heads/||p' |
7375
sort |

git-checkout.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ if [ "$?" -eq 0 ]; then
7171
echo $new > "$GIT_DIR/refs/heads/$newbranch"
7272
branch="$newbranch"
7373
fi
74-
[ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
74+
[ "$branch" ] &&
75+
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD "refs/heads/$branch"
7576
rm -f "$GIT_DIR/MERGE_HEAD"
7677
else
7778
exit 1

0 commit comments

Comments
 (0)