Skip to content

Commit

Permalink
Merge with master.kernel.org:/pub/scm/git/git.git
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Anvin committed Oct 3, 2005
2 parents 039c6f1 + baaac6a commit 79a9d8e
Show file tree
Hide file tree
Showing 44 changed files with 1,360 additions and 451 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ git-ssh-push
git-ssh-upload
git-status
git-stripspace
git-symbolic-ref
git-tag
git-tar-tree
git-unpack-file
Expand Down
15 changes: 14 additions & 1 deletion Documentation/git-clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ git-clone - Clones a repository.

SYNOPSIS
--------
'git clone' [-l] [-u <upload-pack>] [-q] <repository> <directory>
'git clone' [-l [-s]] [-q] [-n] [-u <upload-pack>] <repository> <directory>

DESCRIPTION
-----------
Clones a repository into a newly created directory.

OPTIONS
-------
--local::
-l::
When the repository to clone from is on a local machine,
this flag bypasses normal "git aware" transport
Expand All @@ -25,10 +26,22 @@ OPTIONS
The files under .git/objects/ directory are hardlinked
to save space when possible.

--shared::
-s::
When the repository to clone is on the local machine,
instead of using hard links automatically setup
.git/objects/info/alternatives to share the objects
with the source repository

--quiet::
-q::
Operate quietly. This flag is passed to "rsync" and
"git-clone-pack" commands when given.

-n::
No checkout of HEAD is performed after the clone is complete.

--upload-pack <upload-pack>::
-u <upload-pack>::
When given, and the repository to clone from is handled
by 'git-clone-pack', '--exec=<upload-pack>' is passed to
Expand Down
9 changes: 8 additions & 1 deletion Documentation/git-ls-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SYNOPSIS
(-[c|d|o|i|s|u|k|m])\*
[-x <pattern>|--exclude=<pattern>]
[-X <file>|--exclude-from=<file>]
[--exclude-per-directory=<file>]
[--exclude-per-directory=<file>] [--] [<file>]\*

DESCRIPTION
-----------
Expand Down Expand Up @@ -77,6 +77,13 @@ OPTIONS
K to be killed
? other

--::
Do not interpret any more arguments as options.

<file>::
Files to show. If no files are given all files which match the other
specified criteria are shown.

Output
------
show files just outputs the filename unless '--stage' is specified in
Expand Down
67 changes: 48 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

# DEFINES += -DUSE_STDEV

GIT_VERSION = 0.99.7.GIT
GIT_VERSION = 0.99.8.GIT

CFLAGS = -g -O2 -Wall
ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
Expand Down Expand Up @@ -103,25 +103,29 @@ SIMPLE_PROGRAMS = \

# ... and all the rest
PROGRAMS = \
git-apply$X git-cat-file$X git-checkout-index$X \
git-clone-pack$X git-commit-tree$X git-convert-objects$X \
git-diff-files$X git-diff-index$X git-diff-stages$X \
git-diff-tree$X git-fetch-pack$X git-fsck-objects$X \
git-hash-object$X git-init-db$X git-local-fetch$X \
git-ls-files$X git-ls-tree$X git-merge-base$X \
git-merge-index$X git-mktag$X git-pack-objects$X \
git-patch-id$X git-peek-remote$X git-prune-packed$X \
git-read-tree$X git-receive-pack$X git-rev-list$X \
git-rev-parse$X git-send-pack$X git-show-branch$X \
git-show-index$X git-ssh-fetch$X git-ssh-upload$X \
git-tar-tree$X git-unpack-file$X git-unpack-objects$X \
git-update-index$X git-update-server-info$X \
git-upload-pack$X git-verify-pack$X git-write-tree$X \
git-update-ref$X $(SIMPLE_PROGRAMS)
git-apply$X git-cat-file$X \
git-checkout-index$X git-clone-pack$X git-commit-tree$X \
git-convert-objects$X git-diff-files$X \
git-diff-index$X git-diff-stages$X \
git-diff-tree$X git-fetch-pack$X git-fsck-objects$X \
git-hash-object$X git-init-db$X \
git-local-fetch$X git-ls-files$X git-ls-tree$X git-merge-base$X \
git-merge-index$X git-mktag$X git-pack-objects$X git-patch-id$X \
git-peek-remote$X git-prune-packed$X git-read-tree$X \
git-receive-pack$X git-rev-list$X git-rev-parse$X \
git-send-pack$X git-show-branch$X \
git-show-index$X git-ssh-fetch$X \
git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
git-unpack-objects$X git-update-index$X git-update-server-info$X \
git-upload-pack$X git-verify-pack$X git-write-tree$X \
git-update-ref$X git-symbolic-ref$X \
$(SIMPLE_PROGRAMS)

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

GIT_LIST_TWEAK =

PYMODULES = \
gitMergeCommon.py

Expand All @@ -131,6 +135,8 @@ endif

ifdef WITH_SEND_EMAIL
SCRIPT_PERL += git-send-email.perl
else
GIT_LIST_TWEAK += -e '/^send-email$$/d'
endif

LIB_FILE=libgit.a
Expand Down Expand Up @@ -181,6 +187,10 @@ endif
ifneq (,$(findstring arm,$(shell uname -m)))
ARM_SHA1 = YesPlease
endif
ifeq ($(shell uname -s),OpenBSD)
NEEDS_LIBICONV = YesPlease
PLATFORM_DEFINES += -I/usr/local/include -L/usr/local/lib
endif

ifndef NO_CURL
ifdef CURLDIR
Expand All @@ -206,18 +216,32 @@ endif
ifndef NO_OPENSSL
LIB_OBJS += epoch.o
OPENSSL_LIBSSL = -lssl
ifdef OPENSSLDIR
# Again this may be problematic -- gcc does not always want -R.
CFLAGS += -I$(OPENSSLDIR)/include
OPENSSL_LINK = -L$(OPENSSLDIR)/lib -R$(OPENSSLDIR)/lib
else
OPENSSL_LINK =
endif
else
DEFINES += '-DNO_OPENSSL'
MOZILLA_SHA1 = 1
OPENSSL_LIBSSL =
endif
ifdef NEEDS_SSL_WITH_CRYPTO
LIB_4_CRYPTO = -lcrypto -lssl
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
else
LIB_4_CRYPTO = -lcrypto
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
endif
ifdef NEEDS_LIBICONV
LIB_4_ICONV = -liconv
ifdef ICONVDIR
# Again this may be problematic -- gcc does not always want -R.
CFLAGS += -I$(ICONVDIR)/include
ICONV_LINK = -L$(ICONVDIR)/lib -R$(ICONVDIR)/lib
else
ICONV_LINK =
endif
LIB_4_ICONV = $(ICONV_LINK) -liconv
else
LIB_4_ICONV =
endif
Expand Down Expand Up @@ -273,8 +297,13 @@ all:
git: git.sh Makefile
rm -f $@+ $@
sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
<<<<<<< Makefile
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-e 's/@@X@@/$(X)/g' <$@.sh >$@+
=======
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$(GIT_LIST_TWEAK) <$@.sh >$@+
>>>>>>> .merge_file_3QHyD4
chmod +x $@+
mv $@+ $@

Expand Down
13 changes: 13 additions & 0 deletions apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,16 @@ static int parse_single_patch(char *line, unsigned long size, struct patch *patc
return offset;
}

static inline int metadata_changes(struct patch *patch)
{
return patch->is_rename > 0 ||
patch->is_copy > 0 ||
patch->is_new > 0 ||
patch->is_delete ||
(patch->old_mode && patch->new_mode &&
patch->old_mode != patch->new_mode);
}

static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
{
int hdrsize, patchsize;
Expand All @@ -733,6 +743,9 @@ static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)

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

if (!patchsize && !metadata_changes(patch))
die("patch with only garbage at line %d", linenr);

return offset + hdrsize + patchsize;
}

Expand Down
5 changes: 5 additions & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)
extern char *sha1_file_name(const unsigned char *sha1);
extern char *sha1_pack_name(const unsigned char *sha1);
extern char *sha1_pack_index_name(const unsigned char *sha1);
extern const unsigned char null_sha1[20];

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

Expand Down Expand Up @@ -228,6 +229,10 @@ extern int has_pack_index(const unsigned char *sha1);
extern int get_sha1(const char *str, unsigned char *sha1);
extern int get_sha1_hex(const char *hex, unsigned char *sha1);
extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
extern int read_ref(const char *filename, unsigned char *sha1);
extern const char *resolve_ref(const char *path, unsigned char *sha1, int);
extern int create_symref(const char *git_HEAD, const char *refs_heads_master);
extern int validate_symref(const char *git_HEAD);

/* General helper functions */
extern void usage(const char *err) NORETURN;
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
git-core (0.99.8-0) unstable; urgency=low

* GIT 0.99.8

-- Junio C Hamano <junkio@cox.net> Sun, 2 Oct 2005 12:54:26 -0700

git-core (0.99.7-0) unstable; urgency=low

* GIT 0.99.7
Expand Down
1 change: 0 additions & 1 deletion diff-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ static void show_modified(int oldmode, int mode,

int main(int argc, const char **argv)
{
static const unsigned char null_sha1[20] = { 0, };
const char **pathspec;
const char *prefix = setup_git_directory();
int entries, i;
Expand Down
3 changes: 1 addition & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "diffcore.h"

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

static int use_size_cache;

Expand Down Expand Up @@ -414,7 +413,7 @@ void diff_free_filespec_data(struct diff_filespec *s)
static void prep_temp_blob(struct diff_tempfile *temp,
void *blob,
unsigned long size,
unsigned char *sha1,
const unsigned char *sha1,
int mode)
{
int fd;
Expand Down
28 changes: 10 additions & 18 deletions fsck-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,25 +402,17 @@ static void fsck_object_dir(const char *path)

static int fsck_head_link(void)
{
int fd, count;
char hex[40];
unsigned char sha1[20];
static char path[PATH_MAX], link[PATH_MAX];
const char *git_dir = get_git_dir();

snprintf(path, sizeof(path), "%s/HEAD", git_dir);
if (readlink(path, link, sizeof(link)) < 0)
return error("HEAD is not a symlink");
if (strncmp("refs/heads/", link, 11))
return error("HEAD points to something strange (%s)", link);
fd = open(path, O_RDONLY);
if (fd < 0)
return error("HEAD: %s", strerror(errno));
count = read(fd, hex, sizeof(hex));
close(fd);
if (count < 0)
return error("HEAD: %s", strerror(errno));
if (count < 40 || get_sha1_hex(hex, sha1))
const char *git_HEAD = strdup(git_path("HEAD"));
const char *git_refs_heads_master = resolve_ref(git_HEAD, sha1, 1);
int pfxlen = strlen(git_HEAD) - 4; /* strip .../.git/ part */

if (!git_refs_heads_master)
return error("HEAD is not a symbolic ref");
if (strncmp(git_refs_heads_master + pfxlen, "refs/heads/", 11))
return error("HEAD points to something strange (%s)",
git_refs_heads_master + pfxlen);
if (!memcmp(null_sha1, sha1, 20))
return error("HEAD: not a valid git pointer");
return 0;
}
Expand Down
8 changes: 7 additions & 1 deletion git-archimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@ END
# skip commits already in repo
#
if (ptag($ps->{id})) {
$opt_v && print "Skipping already imported: $ps->{id}\n";
$opt_v && print " * Skipping already imported: $ps->{id}\n";
next;
}

print " * Starting to work on $ps->{id}\n";

#
# create the branch if needed
#
Expand Down Expand Up @@ -675,6 +677,10 @@ sub find_parents {
# that branch.
#
foreach my $branch (keys %branches) {

# check that we actually know about the branch
next unless -e "$git_dir/refs/heads/$branch";

my $mergebase = `git-merge-base $branch $ps->{branch}`;
die "Cannot find merge base for $branch and $ps->{branch}" if $?;
chomp $mergebase;
Expand Down
7 changes: 4 additions & 3 deletions git-bisect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ bisect_start() {
# Verify HEAD. If we were bisecting before this, reset to the
# top-of-line master first!
#
head=$(readlink $GIT_DIR/HEAD) || die "Bad HEAD - I need a symlink"
head=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD) ||
die "Bad HEAD - I need a symbolic ref"
case "$head" in
refs/heads/bisect*)
git checkout master || exit
;;
refs/heads/*)
;;
*)
die "Bad HEAD - strange symlink"
die "Bad HEAD - strange symbolic ref"
;;
esac

Expand Down Expand Up @@ -135,7 +136,7 @@ bisect_next() {
echo "$rev" > "$GIT_DIR/refs/heads/new-bisect"
git checkout new-bisect || exit
mv "$GIT_DIR/refs/heads/new-bisect" "$GIT_DIR/refs/heads/bisect" &&
ln -sf refs/heads/bisect "$GIT_DIR/HEAD"
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD refs/heads/bisect
git-show-branch "$rev"
}

Expand Down
6 changes: 4 additions & 2 deletions git-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ If two arguments, create a new branch <branchname> based off of <start-point>.

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

case "$#" in
0)
headref=$(readlink "$GIT_DIR/HEAD" | sed -e 's|^refs/heads/||')
headref=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD |
sed -e 's|^refs/heads/||')
git-rev-parse --symbolic --all |
sed -ne 's|^refs/heads/||p' |
sort |
Expand Down
3 changes: 2 additions & 1 deletion git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ if [ "$?" -eq 0 ]; then
echo $new > "$GIT_DIR/refs/heads/$newbranch"
branch="$newbranch"
fi
[ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
[ "$branch" ] &&
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD "refs/heads/$branch"
rm -f "$GIT_DIR/MERGE_HEAD"
else
exit 1
Expand Down
Loading

0 comments on commit 79a9d8e

Please sign in to comment.