Skip to content

Commit 429608f

Browse files
author
Junio C Hamano
committed
Merge fixes up to GIT 1.1.2
2 parents b42934d + 59617eb commit 429608f

File tree

9 files changed

+52
-15
lines changed

9 files changed

+52
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ git-diff-files
2828
git-diff-index
2929
git-diff-stages
3030
git-diff-tree
31+
git-describe
3132
git-fetch
3233
git-fetch-pack
3334
git-findtags

Documentation/git-commit.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ information.
2525
OPTIONS
2626
-------
2727
-a|--all::
28-
Update all paths in the index file.
28+
Update all paths in the index file. This flag notices
29+
files that have been modified and deleted, but new files
30+
you have not told about git are not affected.
2931

3032
-c or -C <commit>::
3133
Take existing commit object, and reuse the log message

Documentation/git-reset.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,32 @@ brings your index file and the working tree back to that state,
145145
and resets the tip of the branch to that commit.
146146
------------
147147

148+
Interrupted workflow::
149+
+
150+
You can get interrupted by an ungent fix request while you are
151+
still in the middle of a large change. The files in your
152+
working tree are not in any shape to be committed yet, but you
153+
need to get to the other branch for a quick bugfix.
154+
+
155+
------------
156+
$ git checkout feature ;# you were working in "feature" branch and
157+
$ work work work ;# got interrupted
158+
$ git commit -a -m 'snapshot WIP' <1>
159+
$ git checkout master
160+
$ fix fix fix
161+
$ git commit ;# commit with real log
162+
$ git checkout feature
163+
$ git reset --soft HEAD^ ;# go back to WIP state <2>
164+
$ git reset <3>
165+
166+
<1> This commit will get blown away so a throw-away log message is OK.
167+
<2> This removes the 'WIP' commit from the commit history, and makes
168+
your working tree in the state just before you made that snapshot.
169+
<3> After <2>, the index file still has all the WIP changes you
170+
committed in <1>. This sets it to the last commit you were
171+
basing the WIP changes on.
172+
------------
173+
148174
Author
149175
------
150176
Written by Junio C Hamano <junkio@cox.net> and Linus Torvalds <torvalds@osdl.org>
@@ -156,4 +182,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
156182
GIT
157183
---
158184
Part of the gitlink:git[7] suite
159-

Documentation/pull-fetch-param.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ is often useful.
134134
+
135135
Some short-cut notations are also supported.
136136
+
137-
* For backward compatibility, `tag` is almost ignored;
138-
it just makes the following parameter <tag> to mean a
139-
refspec `refs/tags/<tag>:refs/tags/<tag>`.
137+
* `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`;
138+
used with pull or fetch, it requests fetching everything up to
139+
the given tag.
140140
* A parameter <ref> without a colon is equivalent to
141141
<ref>: when pulling/fetching, and <ref>`:`<ref> when
142142
pushing. That is, do not store it locally if

describe.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ static void describe(char *arg)
132132
if (n) {
133133
printf("%s-g%s\n", n->path,
134134
find_unique_abbrev(cmit->object.sha1, abbrev));
135-
break;
135+
clear_commit_marks(cmit, SEEN);
136+
return;
136137
}
137138
}
138-
clear_commit_marks(cmit, SEEN);
139+
die("cannot describe '%s'", sha1_to_hex(cmit->object.sha1));
139140
}
140141

141142
int main(int argc, char **argv)

name-rev.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ static int name_ref(const char *path, const unsigned char *sha1)
9393
}
9494
if (o && o->type == commit_type) {
9595
struct commit *commit = (struct commit *)o;
96-
const char *p;
9796

98-
while ((p = strchr(path, '/')))
99-
path = p+1;
97+
if (!strncmp(path, "refs/heads/", 11))
98+
path = path + 11;
99+
else if (!strncmp(path, "refs/", 5))
100+
path = path + 5;
100101

101102
name_rev(commit, strdup(path), 0, 0, deref);
102103
}

show-branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ static void append_one_rev(const char *av)
496496
append_ref(av, revkey);
497497
return;
498498
}
499-
if (strchr(av, '*') || strchr(av, '?')) {
499+
if (strchr(av, '*') || strchr(av, '?') || strchr(av, '[')) {
500500
/* glob style match */
501501
int saved_matches = ref_name_cnt;
502502
match_ref_pattern = av;

t/t6010-merge-base.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ H=$(doit 8 H $A $F)
4646

4747
test_expect_success 'compute merge-base (single)' \
4848
'MB=$(git-merge-base G H) &&
49-
expr "$(git-name-rev "$MB")" : "[0-9a-f]* B"'
49+
expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
5050

5151
test_expect_success 'compute merge-base (all)' \
5252
'MB=$(git-merge-base --all G H) &&
53-
expr "$(git-name-rev "$MB")" : "[0-9a-f]* B"'
53+
expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
5454

5555
test_expect_success 'compute merge-base with show-branch' \
5656
'MB=$(git-show-branch --merge-base G H) &&
57-
expr "$(git-name-rev "$MB")" : "[0-9a-f]* B"'
57+
expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
5858

5959
test_done

update-index.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,17 @@ int main(int argc, const char **argv)
534534
struct strbuf buf;
535535
strbuf_init(&buf);
536536
while (1) {
537+
char *path_name;
537538
read_line(&buf, stdin, line_termination);
538539
if (buf.eof)
539540
break;
540-
update_one(buf.buf, prefix, prefix_length);
541+
if (line_termination && buf.buf[0] == '"')
542+
path_name = unquote_c_style(buf.buf, NULL);
543+
else
544+
path_name = buf.buf;
545+
update_one(path_name, prefix, prefix_length);
546+
if (path_name != buf.buf)
547+
free(path_name);
541548
}
542549
}
543550
if (active_cache_changed) {

0 commit comments

Comments
 (0)