Skip to content

Commit

Permalink
GIT 0.99.9c
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 3, 2005
2 parents 235d521 + 2be8fd0 commit 6ddc096
Show file tree
Hide file tree
Showing 25 changed files with 219 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ git-merge-base
git-merge-index
git-merge-octopus
git-merge-one-file
git-merge-ours
git-merge-recursive
git-merge-resolve
git-merge-stupid
Expand Down
34 changes: 34 additions & 0 deletions Documentation/git-rev-parse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ OPTIONS
path of the current directory relative to the top-level
directory.

--since=datestring, --after=datestring::
Parses the date string, and outputs corresponding
--max-age= parameter for git-rev-list command.

--until=datestring, --before=datestring::
Parses the date string, and outputs corresponding
--min-age= parameter for git-rev-list command.

<args>...::
Flags and parameters to be parsed.

Expand Down Expand Up @@ -124,6 +132,32 @@ which is passed to 'git-rev-list'. Two revision parameters
concatenated with '..' is a short-hand for writing a range
between them. I.e. 'r1..r2' is equivalent to saying '{caret}r1 r2'

Here is an illustration, by Jon Loeliger. Both node B and C are
a commit parents of commit node A. Parent commits are ordered
left-to-right.

G H I J
\ / \ /
D E F
\ | /
\ | /
\|/
B C
\ /
\ /
A

A = = A^0
B = A^ = A^1 = A~1
C = A^2 = A^2
D = A^^ = A^1^1 = A~2
E = B^2 = A^^2
F = B^3 = A^^3
G = A^^^ = A^1^1^1 = A~3
H = D^2 = B^^2 = A^^^2 = A~2^2
I = F^ = B^3^ = A^^3^
J = F^2 = B^3^2 = A^^3^2


Author
------
Expand Down
35 changes: 35 additions & 0 deletions Documentation/tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,41 @@ the same diff that we've already seen several times, we can now do
(again, `-p` means to show the difference as a human-readable patch),
and it will show what the last commit (in `HEAD`) actually changed.

[NOTE]
============
Here is an ASCII art by Jon Loeliger that illustrates how
various diff-\* commands compare things.

diff-tree
+----+
| |
| |
V V
+-----------+
| Object DB |
| Backing |
| Store |
+-----------+
^ ^
| |
| | diff-index --cached
| |
diff-index | V
| +-----------+
| | Index |
| | "cache" |
| +-----------+
| ^
| |
| | diff-files
| |
V V
+-----------+
| Working |
| Directory |
+-----------+
============

More interestingly, you can also give `git-diff-tree` the `-v` flag, which
tells it to also show the commit message and author and date of the
commit, and you can tell it to show a whole series of diffs.
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# DEFINES += -DUSE_STDEV

GIT_VERSION = 0.99.9b
GIT_VERSION = 0.99.9c

CFLAGS = -g -O2 -Wall
ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
Expand Down Expand Up @@ -89,7 +89,7 @@ SCRIPT_SH = \
git-tag.sh git-verify-tag.sh git-whatchanged.sh git.sh \
git-applymbox.sh git-applypatch.sh git-am.sh \
git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
git-merge-resolve.sh git-grep.sh
git-merge-resolve.sh git-merge-ours.sh git-grep.sh

SCRIPT_PERL = \
git-archimport.perl git-cvsimport.perl git-relink.perl \
Expand Down Expand Up @@ -189,9 +189,9 @@ endif
ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease
NEEDS_NSL = YesPlease
NEEDS_LIBICONV = YesPlease
SHELL_PATH = /bin/bash
NO_STRCASESTR = YesPlease
CURLDIR = /opt/sfw
INSTALL = ginstall
TAR = gtar
PLATFORM_DEFINES += -D__EXTENSIONS__
Expand Down Expand Up @@ -397,8 +397,8 @@ doc:
test: all
$(MAKE) -C t/ all

test-date$X: test-date.c date.o
$(CC) $(ALL_CFLAGS) -o $@ test-date.c date.o
test-date$X: test-date.c date.o ctype.o
$(CC) $(ALL_CFLAGS) -o $@ test-date.c date.o ctype.o

test-delta$X: test-delta.c diff-delta.o patch-delta.o
$(CC) $(ALL_CFLAGS) -o $@ $^
Expand Down
40 changes: 40 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,46 @@ save the note about that state, in practice we tend to just write the
result to the file `.git/HEAD`, so that we can always see what the
last committed state was.

Here is an ASCII art by Jon Loeliger that illustrates how
various pieces fit together.

------------

commit-tree
commit obj
+----+
| |
| |
V V
+-----------+
| Object DB |
| Backing |
| Store |
+-----------+
^
write-tree | |
tree obj | |
| | read-tree
| | tree obj
V
+-----------+
| Index |
| "cache" |
+-----------+
update-index ^
blob obj | |
| |
checkout-index -u | | checkout-index
stat | | blob obj
V
+-----------+
| Working |
| Directory |
+-----------+

------------


6) Examining the data
~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static struct commit *check_commit(struct object *obj,
struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
int quiet)
{
struct object *obj = deref_tag(parse_object(sha1));
struct object *obj = deref_tag(parse_object(sha1), NULL, 0);

if (!obj)
return NULL;
Expand Down
8 changes: 8 additions & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ static int get_next_char(void)
c = '\n';
if ((f = config_file) != NULL) {
c = fgetc(f);
if (c == '\r') {
/* DOS like systems */
c = fgetc(f);
if (c != '\n') {
ungetc(c, f);
c = '\r';
}
}
if (c == '\n')
config_linenr++;
if (c == EOF) {
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.9c-0) unstable; urgency=low

* GIT 0.99.9c

-- Junio C Hamano <junkio@cox.net> Thu, 3 Nov 2005 15:44:54 -0800

git-core (0.99.9b-0) unstable; urgency=low

* GIT 0.99.9b
Expand Down
7 changes: 4 additions & 3 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ static void rev_list_push(struct commit *commit, int mark)

static int rev_list_insert_ref(const char *path, const unsigned char *sha1)
{
struct object *o = deref_tag(parse_object(sha1));
struct object *o = deref_tag(parse_object(sha1), path, 0);

if (o->type == commit_type)
if (o && o->type == commit_type)
rev_list_push((struct commit *)o, SEEN);

return 0;
Expand Down Expand Up @@ -317,7 +317,8 @@ static int everything_local(struct ref **refs, int nr_match, char **match)
* Don't mark them common yet; the server has to be told so first.
*/
for (ref = *refs; ref; ref = ref->next) {
struct object *o = deref_tag(lookup_object(ref->old_sha1));
struct object *o = deref_tag(lookup_object(ref->old_sha1),
NULL, 0);

if (!o || o->type != commit_type || !(o->flags & COMPLETE))
continue;
Expand Down
2 changes: 2 additions & 0 deletions git-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,6 @@ rev=$(git-rev-parse --verify "$head") || exit
git-check-ref-format "heads/$branchname" ||
die "we do not like '$branchname' as a branch name."

leading=`expr "refs/heads/$branchname" : '\(.*\)/'` &&
mkdir -p "$GIT_DIR/$leading" &&
echo $rev > "$GIT_DIR/refs/heads/$branchname"
4 changes: 3 additions & 1 deletion git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ fi
#
if [ "$?" -eq 0 ]; then
if [ "$newbranch" ]; then
echo $new > "$GIT_DIR/refs/heads/$newbranch"
leading=`expr "refs/heads/$newbranch" : '\(.*\)/'` &&
mkdir -p "$GIT_DIR/$leading" &&
echo $new >"$GIT_DIR/refs/heads/$newbranch" || exit
branch="$newbranch"
fi
[ "$branch" ] &&
Expand Down
15 changes: 11 additions & 4 deletions git-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,17 @@ cd $D || exit

if test -f ".git/HEAD"
then
mkdir -p .git/remotes || exit
echo >.git/remotes/origin \
"URL: $repo
Pull: master:origin"
head_points_at=`git-symbolic-ref HEAD`
case "$head_points_at" in
refs/heads/*)
head_points_at=`expr "$head_points_at" : 'refs/heads/\(.*\)'`
mkdir -p .git/remotes &&
echo >.git/remotes/origin \
"URL: $repo
Pull: $head_points_at:origin"
cp ".git/refs/heads/$head_points_at" .git/refs/heads/origin
esac

case "$no_checkout" in
'')
git checkout
Expand Down
6 changes: 3 additions & 3 deletions git-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ then
elif test "$use_commit" != ""
then
git-cat-file commit "$use_commit" | sed -e '1,/^$/d'
elif test -f "$GIT_DIR/MERGE_HEAD" && test -f "$GIT_DIR/MERGE_MSG"
then
cat "$GIT_DIR/MERGE_MSG"
fi | git-stripspace >"$GIT_DIR"/COMMIT_EDITMSG

case "$signoff" in
Expand All @@ -144,9 +147,6 @@ t)
esac

if [ -f "$GIT_DIR/MERGE_HEAD" ]; then

test -f "$GIT_DIR/MERGE_MSG" && cat "$GIT_DIR/MERGE_MSG"

echo "#"
echo "# It looks like your may be committing a MERGE."
echo "# If this is not correct, please remove the file"
Expand Down
14 changes: 14 additions & 0 deletions git-merge-ours.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
# Pretend we resolved the heads, but declare our tree trumps everybody else.
#

# We need to exit with 2 if the index does not match our HEAD tree,
# because the current index is what we will be committing as the
# merge result.

test "$(git-diff-index --cached --name-status HEAD)" = "" || exit 2

exit 0
Loading

0 comments on commit 6ddc096

Please sign in to comment.