Skip to content

Commit b2f6eab

Browse files
committed
Merge branch 'maint'
* maint: Prepare draft release notes to 1.7.4.2 gitweb: highlight: replace tabs with spaces make_absolute_path: return the input path if it points to our buffer valgrind: ignore SSE-based strlen invalid reads diff --submodule: split into bite-sized pieces cherry: split off function to print output lines branch: split off function that writes tracking info and commit subject standardize brace placement in struct definitions compat: make gcc bswap an inline function enums: omit trailing comma for portability Conflicts: RelNotes
2 parents 0631623 + fbcda3c commit b2f6eab

27 files changed

+215
-178
lines changed

Documentation/RelNotes/1.7.4.2.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Git v1.7.4.2 Release Notes
2+
==========================
3+
4+
Fixes since v1.7.4.1
5+
--------------------
6+
7+
* Many documentation updates to match "git cmd -h" output and the
8+
git-cmd manual page.
9+
10+
* "git clone /no/such/path" did not fail correctly.
11+
12+
* "git commit" did not correctly error out when the user asked to use a
13+
non existent file as the commit message template.
14+
15+
* "git diff --stat -B" ran on binary files counted the changes in lines,
16+
which was nonsensical.
17+
18+
* "git diff -M" opportunistically detected copies, which was not
19+
necessarily a good thing, especially when it is internally run by
20+
recursive merge.
21+
22+
* "git difftool" didn't tell (g)vimdiff that the files it is reading are
23+
to be opened read-only.
24+
25+
* "git merge" didn't pay attention to prepare-commit-msg hook, even
26+
though if a merge is conflicted and manually resolved, the subsequent
27+
"git commit" would have triggered the hook, which was inconsistent.
28+
29+
* "git patch-id" (and commands like "format-patch --ignore-in-upstream"
30+
that use it as their internal logic) handled changes to files that end
31+
with incomplete lines incorrectly.
32+
33+
* The official value to tell "git push" to push the current branch back
34+
to update the upstream branch it forked from is now called "upstream".
35+
The old name "tracking" is and will be supported.
36+
37+
* gitweb's "highlight" interface mishandled tabs.
38+
39+
* gitweb had a few forward-incompatible syntactic constructs and
40+
also used incorrect variable when showing the file mode in a diff.
41+
42+
And other minor fixes and documentation updates.

abspath.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ const char *make_absolute_path(const char *path)
2424
char *last_elem = NULL;
2525
struct stat st;
2626

27+
/* We've already done it */
28+
if (path == buf || path == next_buf)
29+
return path;
30+
2731
if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
2832
die ("Too long path: %.*s", 60, path);
2933

builtin/add.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ static const char * const builtin_add_usage[] = {
2121
static int patch_interactive, add_interactive, edit_interactive;
2222
static int take_worktree_changes;
2323

24-
struct update_callback_data
25-
{
24+
struct update_callback_data {
2625
int flags;
2726
int add_errors;
2827
};

builtin/blame.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,8 +1312,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
13121312
/*
13131313
* Information on commits, used for output.
13141314
*/
1315-
struct commit_info
1316-
{
1315+
struct commit_info {
13171316
const char *author;
13181317
const char *author_mail;
13191318
unsigned long author_time;

builtin/branch.c

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,30 @@ static int matches_merge_filter(struct commit *commit)
390390
return (is_merged == (merge_filter == SHOW_MERGED));
391391
}
392392

393+
static void add_verbose_info(struct strbuf *out, struct ref_item *item,
394+
int verbose, int abbrev)
395+
{
396+
struct strbuf subject = STRBUF_INIT, stat = STRBUF_INIT;
397+
const char *sub = " **** invalid ref ****";
398+
struct commit *commit = item->commit;
399+
400+
if (commit && !parse_commit(commit)) {
401+
struct pretty_print_context ctx = {0};
402+
pretty_print_commit(CMIT_FMT_ONELINE, commit,
403+
&subject, &ctx);
404+
sub = subject.buf;
405+
}
406+
407+
if (item->kind == REF_LOCAL_BRANCH)
408+
fill_tracking_info(&stat, item->name, verbose > 1);
409+
410+
strbuf_addf(out, " %s %s%s",
411+
find_unique_abbrev(item->commit->object.sha1, abbrev),
412+
stat.buf, sub);
413+
strbuf_release(&stat);
414+
strbuf_release(&subject);
415+
}
416+
393417
static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
394418
int abbrev, int current, char *prefix)
395419
{
@@ -430,27 +454,9 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
430454

431455
if (item->dest)
432456
strbuf_addf(&out, " -> %s", item->dest);
433-
else if (verbose) {
434-
struct strbuf subject = STRBUF_INIT, stat = STRBUF_INIT;
435-
const char *sub = " **** invalid ref ****";
436-
437-
commit = item->commit;
438-
if (commit && !parse_commit(commit)) {
439-
struct pretty_print_context ctx = {0};
440-
pretty_print_commit(CMIT_FMT_ONELINE, commit,
441-
&subject, &ctx);
442-
sub = subject.buf;
443-
}
444-
445-
if (item->kind == REF_LOCAL_BRANCH)
446-
fill_tracking_info(&stat, item->name, verbose > 1);
447-
448-
strbuf_addf(&out, " %s %s%s",
449-
find_unique_abbrev(item->commit->object.sha1, abbrev),
450-
stat.buf, sub);
451-
strbuf_release(&stat);
452-
strbuf_release(&subject);
453-
}
457+
else if (verbose)
458+
/* " f7c0c00 [ahead 58, behind 197] vcs-svn: drop obj_pool.h" */
459+
add_verbose_info(&out, item, verbose, abbrev);
454460
printf("%s\n", out.buf);
455461
strbuf_release(&name);
456462
strbuf_release(&out);

builtin/grep.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ enum work_type {WORK_SHA1, WORK_FILE};
4040
* threads. The producer adds struct work_items to 'todo' and the
4141
* consumers pick work items from the same array.
4242
*/
43-
struct work_item
44-
{
43+
struct work_item {
4544
enum work_type type;
4645
char *name;
4746

builtin/index-pack.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
static const char index_pack_usage[] =
1414
"git index-pack [-v] [-o <index-file>] [ --keep | --keep=<msg> ] [--strict] (<pack-file> | --stdin [--fix-thin] [<pack-file>])";
1515

16-
struct object_entry
17-
{
16+
struct object_entry {
1817
struct pack_idx_entry idx;
1918
unsigned long size;
2019
unsigned int hdr_size;
@@ -44,8 +43,7 @@ struct base_data {
4443
#define FLAG_LINK (1u<<20)
4544
#define FLAG_CHECKED (1u<<21)
4645

47-
struct delta_entry
48-
{
46+
struct delta_entry {
4947
union delta_base base;
5048
int obj_no;
5149
};

builtin/log.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,23 @@ static const char * const cherry_usage[] = {
13521352
NULL
13531353
};
13541354

1355+
static void print_commit(char sign, struct commit *commit, int verbose,
1356+
int abbrev)
1357+
{
1358+
if (!verbose) {
1359+
printf("%c %s\n", sign,
1360+
find_unique_abbrev(commit->object.sha1, abbrev));
1361+
} else {
1362+
struct strbuf buf = STRBUF_INIT;
1363+
struct pretty_print_context ctx = {0};
1364+
pretty_print_commit(CMIT_FMT_ONELINE, commit, &buf, &ctx);
1365+
printf("%c %s %s\n", sign,
1366+
find_unique_abbrev(commit->object.sha1, abbrev),
1367+
buf.buf);
1368+
strbuf_release(&buf);
1369+
}
1370+
}
1371+
13551372
int cmd_cherry(int argc, const char **argv, const char *prefix)
13561373
{
13571374
struct rev_info revs;
@@ -1436,22 +1453,7 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
14361453
commit = list->item;
14371454
if (has_commit_patch_id(commit, &ids))
14381455
sign = '-';
1439-
1440-
if (verbose) {
1441-
struct strbuf buf = STRBUF_INIT;
1442-
struct pretty_print_context ctx = {0};
1443-
pretty_print_commit(CMIT_FMT_ONELINE, commit,
1444-
&buf, &ctx);
1445-
printf("%c %s %s\n", sign,
1446-
find_unique_abbrev(commit->object.sha1, abbrev),
1447-
buf.buf);
1448-
strbuf_release(&buf);
1449-
}
1450-
else {
1451-
printf("%c %s\n", sign,
1452-
find_unique_abbrev(commit->object.sha1, abbrev));
1453-
}
1454-
1456+
print_commit(sign, commit, verbose, abbrev);
14551457
list = list->next;
14561458
}
14571459

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ extern enum safe_crlf safe_crlf;
585585
enum auto_crlf {
586586
AUTO_CRLF_FALSE = 0,
587587
AUTO_CRLF_TRUE = 1,
588-
AUTO_CRLF_INPUT = -1,
588+
AUTO_CRLF_INPUT = -1
589589
};
590590

591591
extern enum auto_crlf auto_crlf;

commit.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ enum cmit_fmt {
6868
CMIT_FMT_UNSPECIFIED
6969
};
7070

71-
struct pretty_print_context
72-
{
71+
struct pretty_print_context {
7372
int abbrev;
7473
const char *subject;
7574
const char *after_subject;

0 commit comments

Comments
 (0)