Skip to content

Commit 6ab5889

Browse files
author
Junio C Hamano
committed
GIT 1.0.4
Signed-off-by: Junio C Hamano <junkio@cox.net>
2 parents c63da8d + ac44f3e commit 6ab5889

File tree

9 files changed

+109
-17
lines changed

9 files changed

+109
-17
lines changed

Documentation/git-ls-files.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ 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>] [--] [<file>]\*
16+
[--exclude-per-directory=<file>]
17+
[--full-name] [--] [<file>]\*
1718

1819
DESCRIPTION
1920
-----------
@@ -77,6 +78,12 @@ OPTIONS
7778
K:: to be killed
7879
? other
7980

81+
--full-name::
82+
When run from a subdirectory, the command usually
83+
outputs paths relative to the current directory. This
84+
option forces paths to be output relative to the project
85+
top directory.
86+
8087
--::
8188
Do not interpret any more arguments as options.
8289

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ all:
5555
# Define USE_STDEV below if you want git to care about the underlying device
5656
# change being considered an inode change from the update-cache perspective.
5757

58-
GIT_VERSION = 1.0.3
58+
GIT_VERSION = 1.0.4
5959

6060
# CFLAGS and LDFLAGS are for the users to override from the command line.
6161

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
git-core (1.0.4-0) unstable; urgency=low
2+
3+
* GIT 1.0.4.
4+
5+
-- Junio C Hamano <junkio@cox.net> Sat, 24 Dec 2005 00:01:20 -0800
6+
17
git-core (1.0.3-0) unstable; urgency=low
28

39
* GIT 1.0.3 maintenance release.

git-merge.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ case "$use_strategies" in
209209
esac
210210

211211
result_tree= best_cnt=-1 best_strategy= wt_strategy=
212+
merge_was_ok=
212213
for strategy in $use_strategies
213214
do
214215
test "$wt_strategy" = '' || {
@@ -228,6 +229,7 @@ do
228229
exit=$?
229230
if test "$no_commit" = t && test "$exit" = 0
230231
then
232+
merge_was_ok=t
231233
exit=1 ;# pretend it left conflicts.
232234
fi
233235

@@ -293,4 +295,11 @@ do
293295
done >"$GIT_DIR/MERGE_HEAD"
294296
echo $merge_msg >"$GIT_DIR/MERGE_MSG"
295297

296-
die "Automatic merge failed/prevented; fix up by hand"
298+
if test "$merge_was_ok" = t
299+
then
300+
echo >&2 \
301+
"Automatic merge went well; stopped before committing as requested"
302+
exit 0
303+
else
304+
die "Automatic merge failed; fix up by hand"
305+
fi

ls-files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static void verify_pathspec(void)
562562
static const char ls_files_usage[] =
563563
"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
564564
"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
565-
"[ --exclude-per-directory=<filename> ] [--] [<file>]*";
565+
"[ --exclude-per-directory=<filename> ] [--full-name] [--] [<file>]*";
566566

567567
int main(int argc, const char **argv)
568568
{

mailinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static void convert_to_utf8(char *line, char *charset)
472472
char *in, *out;
473473
size_t insize, outsize, nrc;
474474
char outbuf[4096]; /* cheat */
475-
static char latin_one[] = "latin-1";
475+
static char latin_one[] = "latin1";
476476
char *input_charset = *charset ? charset : latin_one;
477477
iconv_t conv = iconv_open(metainfo_charset, input_charset);
478478

sha1_file.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,16 @@ struct packed_git *packed_git;
321321
static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
322322
void **idx_map_)
323323
{
324+
SHA_CTX ctx;
325+
unsigned char sha1[20];
324326
void *idx_map;
325327
unsigned int *index;
326328
unsigned long idx_size;
327329
int nr, i;
328-
int fd = open(path, O_RDONLY);
330+
int fd;
329331
struct stat st;
332+
333+
fd = open(path, O_RDONLY);
330334
if (fd < 0)
331335
return -1;
332336
if (fstat(fd, &st)) {
@@ -364,6 +368,16 @@ static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
364368
if (idx_size != 4*256 + nr * 24 + 20 + 20)
365369
return error("wrong index file size");
366370

371+
/*
372+
* File checksum.
373+
*/
374+
SHA1_Init(&ctx);
375+
SHA1_Update(&ctx, idx_map, idx_size-20);
376+
SHA1_Final(sha1, &ctx);
377+
378+
if (memcmp(sha1, idx_map + idx_size - 20, 20))
379+
return error("index checksum mismatch");
380+
367381
return 0;
368382
}
369383

show-branch.c

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,54 @@ static void show_one_commit(struct commit *commit, int no_name)
284284
static char *ref_name[MAX_REVS + 1];
285285
static int ref_name_cnt;
286286

287+
static const char *find_digit_prefix(const char *s, int *v)
288+
{
289+
const char *p;
290+
int ver;
291+
char ch;
292+
293+
for (p = s, ver = 0;
294+
'0' <= (ch = *p) && ch <= '9';
295+
p++)
296+
ver = ver * 10 + ch - '0';
297+
*v = ver;
298+
return p;
299+
}
300+
301+
302+
static int version_cmp(const char *a, const char *b)
303+
{
304+
while (1) {
305+
int va, vb;
306+
307+
a = find_digit_prefix(a, &va);
308+
b = find_digit_prefix(b, &vb);
309+
if (va != vb)
310+
return va - vb;
311+
312+
while (1) {
313+
int ca = *a;
314+
int cb = *b;
315+
if ('0' <= ca && ca <= '9')
316+
ca = 0;
317+
if ('0' <= cb && cb <= '9')
318+
cb = 0;
319+
if (ca != cb)
320+
return ca - cb;
321+
if (!ca)
322+
break;
323+
a++;
324+
b++;
325+
}
326+
if (!*a && !*b)
327+
return 0;
328+
}
329+
}
330+
287331
static int compare_ref_name(const void *a_, const void *b_)
288332
{
289333
const char * const*a = a_, * const*b = b_;
290-
return strcmp(*a, *b);
334+
return version_cmp(*a, *b);
291335
}
292336

293337
static void sort_ref_range(int bottom, int top)
@@ -299,8 +343,15 @@ static void sort_ref_range(int bottom, int top)
299343
static int append_ref(const char *refname, const unsigned char *sha1)
300344
{
301345
struct commit *commit = lookup_commit_reference_gently(sha1, 1);
346+
int i;
347+
302348
if (!commit)
303349
return 0;
350+
/* Avoid adding the same thing twice */
351+
for (i = 0; i < ref_name_cnt; i++)
352+
if (!strcmp(refname, ref_name[i]))
353+
return 0;
354+
304355
if (MAX_REVS <= ref_name_cnt) {
305356
fprintf(stderr, "warning: ignoring %s; "
306357
"cannot handle more than %d refs\n",
@@ -512,19 +563,17 @@ int main(int ac, char **av)
512563
if (1 < independent + merge_base + (extra != 0))
513564
usage(show_branch_usage);
514565

566+
/* If nothing is specified, show all branches by default */
567+
if (ac + all_heads + all_tags == 0)
568+
all_heads = 1;
569+
515570
if (all_heads + all_tags)
516571
snarf_refs(all_heads, all_tags);
517-
518-
if (ac) {
519-
while (0 < ac) {
520-
append_one_rev(*av);
521-
ac--; av++;
522-
}
523-
}
524-
else {
525-
/* If no revs given, then add heads */
526-
snarf_refs(1, 0);
572+
while (0 < ac) {
573+
append_one_rev(*av);
574+
ac--; av++;
527575
}
576+
528577
if (!ref_name_cnt) {
529578
fprintf(stderr, "No revs to be shown.\n");
530579
exit(0);

t/t5300-pack-object.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ test_expect_success \
163163
else :;
164164
fi &&
165165
166+
cp test-1-${packname_1}.pack test-3.pack &&
167+
dd if=/dev/zero of=test-3.idx count=1 bs=1 conv=notrunc seek=1200 &&
168+
if git-verify-pack test-3.pack
169+
then false
170+
else :;
171+
fi &&
172+
166173
:'
167174

168175
test_expect_success \

0 commit comments

Comments
 (0)