Skip to content

Commit 8c5b85c

Browse files
committed
Merge branch 'maint'
* maint: More friendly message when locking the index fails. Document git blame --reverse. Documentation: Note file formats send-email accepts
2 parents 7d233de + e43a6fd commit 8c5b85c

File tree

6 files changed

+38
-4
lines changed

6 files changed

+38
-4
lines changed

Documentation/blame-options.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ of lines before or after the line given by <start>.
4141
-S <revs-file>::
4242
Use revs from revs-file instead of calling linkgit:git-rev-list[1].
4343

44+
--reverse::
45+
Walk history forward instead of backward. Instead of showing
46+
the revision in which a line appeared, this shows the last
47+
revision in which a line has existed. This requires a range of
48+
revision like START..END where the path to blame exists in
49+
START.
50+
4451
-p::
4552
--porcelain::
4653
Show in a format designed for machine consumption.

Documentation/git-blame.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
[verse]
1111
'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [--incremental] [-L n,m]
1212
[-S <revs-file>] [-M] [-C] [-C] [--since=<date>]
13-
[<rev> | --contents <file>] [--] <file>
13+
[<rev> | --contents <file> | --reverse <rev>] [--] <file>
1414

1515
DESCRIPTION
1616
-----------

Documentation/git-send-email.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ The header of the email is configurable by command line options. If not
1919
specified on the command line, the user will be prompted with a ReadLine
2020
enabled interface to provide the necessary information.
2121

22+
There are two formats accepted for patch files:
23+
24+
1. mbox format files
25+
+
26+
This is what linkgit:git-format-patch[1] generates. Most headers and MIME
27+
formatting are ignored.
28+
29+
2. The original format used by Greg Kroah-Hartman's 'send_lots_of_email.pl'
30+
script
31+
+
32+
This format expects the first line of the file to contain the "Cc:" value
33+
and the "Subject:" of the message as the second line.
34+
2235

2336
OPTIONS
2437
-------

builtin-update-index.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
742742
if (newfd < 0) {
743743
if (refresh_flags & REFRESH_QUIET)
744744
exit(128);
745-
die("unable to create '%s.lock': %s",
746-
get_index_file(), strerror(lock_error));
745+
unable_to_lock_index_die(get_index_file(), lock_error);
747746
}
748747
if (write_cache(newfd, active_cache, active_nr) ||
749748
commit_locked_index(lock_file))

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ struct lock_file {
484484
};
485485
#define LOCK_DIE_ON_ERROR 1
486486
#define LOCK_NODEREF 2
487+
extern NORETURN void unable_to_lock_index_die(const char *path, int err);
487488
extern int hold_lock_file_for_update(struct lock_file *, const char *path, int);
488489
extern int hold_lock_file_for_append(struct lock_file *, const char *path, int);
489490
extern int commit_lock_file(struct lock_file *);

lockfile.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,25 @@ static int lock_file(struct lock_file *lk, const char *path, int flags)
155155
return lk->fd;
156156
}
157157

158+
159+
NORETURN void unable_to_lock_index_die(const char *path, int err)
160+
{
161+
if (errno == EEXIST) {
162+
die("Unable to create '%s.lock': %s.\n\n"
163+
"If no other git process is currently running, this probably means a\n"
164+
"git process crashed in this repository earlier. Make sure no other git\n"
165+
"process is running and remove the file manually to continue.",
166+
path, strerror(err));
167+
} else {
168+
die("Unable to create '%s.lock': %s", path, strerror(err));
169+
}
170+
}
171+
158172
int hold_lock_file_for_update(struct lock_file *lk, const char *path, int flags)
159173
{
160174
int fd = lock_file(lk, path, flags);
161175
if (fd < 0 && (flags & LOCK_DIE_ON_ERROR))
162-
die("unable to create '%s.lock': %s", path, strerror(errno));
176+
unable_to_lock_index_die(path, errno);
163177
return fd;
164178
}
165179

0 commit comments

Comments
 (0)