From: Junio C Hamano Date: Fri, 20 Feb 2009 07:44:07 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.6.2-rc2~18 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8c5b85ce87d15e4db37a6408f03b0eb71dde080e?ds=inline;hp=-c Merge branch 'maint' * maint: More friendly message when locking the index fails. Document git blame --reverse. Documentation: Note file formats send-email accepts --- 8c5b85ce87d15e4db37a6408f03b0eb71dde080e diff --combined Documentation/git-blame.txt index 6999cf2a65,cc934e55c3..4ef54d6602 --- a/Documentation/git-blame.txt +++ b/Documentation/git-blame.txt @@@ -10,7 -10,7 +10,7 @@@ SYNOPSI [verse] 'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [--incremental] [-L n,m] [-S ] [-M] [-C] [-C] [--since=] - [ | --contents ] [--] + [ | --contents | --reverse ] [--] DESCRIPTION ----------- @@@ -184,12 -184,6 +184,12 @@@ there is ever added information (like t commit commentary), a blame viewer won't ever care. +MAPPING AUTHORS +--------------- + +include::mailmap.txt[] + + SEE ALSO -------- linkgit:git-annotate[1] diff --combined builtin-update-index.c index 5604977505,daca0f775e..dd43d5bef4 --- a/builtin-update-index.c +++ b/builtin-update-index.c @@@ -486,7 -486,7 +486,7 @@@ static int unresolve_one(const char *pa static void read_head_pointers(void) { if (read_ref("HEAD", head_sha1)) - die("No HEAD -- no initial commit yet?\n"); + die("No HEAD -- no initial commit yet?"); if (read_ref("MERGE_HEAD", merge_head_sha1)) { fprintf(stderr, "Not in the middle of a merge.\n"); exit(0); @@@ -742,8 -742,7 +742,7 @@@ int cmd_update_index(int argc, const ch if (newfd < 0) { if (refresh_flags & REFRESH_QUIET) exit(128); - die("unable to create '%s.lock': %s", - get_index_file(), strerror(lock_error)); + unable_to_lock_index_die(get_index_file(), lock_error); } if (write_cache(newfd, active_cache, active_nr) || commit_locked_index(lock_file)) diff --combined cache.h index 21bbf9b119,0e2f219b2b..21a63103d5 --- a/cache.h +++ b/cache.h @@@ -484,6 -484,7 +484,7 @@@ struct lock_file }; #define LOCK_DIE_ON_ERROR 1 #define LOCK_NODEREF 2 + extern NORETURN void unable_to_lock_index_die(const char *path, int err); extern int hold_lock_file_for_update(struct lock_file *, const char *path, int); extern int hold_lock_file_for_append(struct lock_file *, const char *path, int); extern int commit_lock_file(struct lock_file *); @@@ -624,9 -625,8 +625,9 @@@ int is_directory(const char *) const char *make_absolute_path(const char *path); const char *make_nonrelative_path(const char *path); const char *make_relative_path(const char *abs, const char *base); -int normalize_absolute_path(char *buf, const char *path); +int normalize_path_copy(char *dst, const char *src); int longest_ancestor_length(const char *path, const char *prefix_list); +char *strip_path_suffix(const char *path, const char *suffix); /* Read and unpack a sha1 file into memory, write memory to a sha1 file */ extern int sha1_object_info(const unsigned char *, unsigned long *); @@@ -636,6 -636,9 +637,6 @@@ extern int write_sha1_file(void *buf, u extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *); extern int force_object_loose(const unsigned char *sha1, time_t mtime); -/* just like read_sha1_file(), but non fatal in presence of bad objects */ -extern void *read_object(const unsigned char *sha1, enum object_type *type, unsigned long *size); - /* global flag to enable extra checks when accessing packed objects */ extern int do_check_packed_object_crc; @@@ -668,7 -671,6 +669,7 @@@ extern int read_ref(const char *filenam extern const char *resolve_ref(const char *path, unsigned char *sha1, int, int *); extern int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref); extern int dwim_log(const char *str, int len, unsigned char *sha1, char **ref); +extern int interpret_nth_last_branch(const char *str, struct strbuf *); extern int refname_match(const char *abbrev_name, const char *full_name, const char **rules); extern const char *ref_rev_parse_rules[]; @@@ -723,10 -725,6 +724,10 @@@ struct checkout extern int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *topath); extern int has_symlink_leading_path(int len, const char *name); +extern int has_symlink_or_noent_leading_path(int len, const char *name); +extern int has_dirs_only_path(int len, const char *name, int prefix_len); +extern void invalidate_lstat_cache(int len, const char *name); +extern void clear_lstat_cache(void); extern struct alternate_object_database { struct alternate_object_database *next; @@@ -869,7 -867,6 +870,7 @@@ extern int user_ident_explicitly_given extern const char *git_commit_encoding; extern const char *git_log_output_encoding; +extern const char *git_mailmap_file; /* IO helper functions */ extern void maybe_flush_or_die(FILE *, const char *); @@@ -945,6 -942,7 +946,6 @@@ extern int ws_fix_copy(char *, const ch extern int ws_blank_line(const char *line, int len, unsigned ws_rule); /* ls-files */ -int pathspec_match(const char **spec, char *matched, const char *filename, int skiplen); int report_path_error(const char *ps_matched, const char **pathspec, int prefix_offset); void overlay_tree_on_cache(const char *tree_name, const char *prefix); diff --combined lockfile.c index 021c3375c1,8e556ff8c9..1db1a2fefc --- a/lockfile.c +++ b/lockfile.c @@@ -2,7 -2,6 +2,7 @@@ * Copyright (c) 2005, Junio C Hamano */ #include "cache.h" +#include "sigchain.h" static struct lock_file *lock_file_list; static const char *alternate_index_output; @@@ -25,7 -24,7 +25,7 @@@ static void remove_lock_file(void static void remove_lock_file_on_signal(int signo) { remove_lock_file(); - signal(signo, SIG_DFL); + sigchain_pop(signo); raise(signo); } @@@ -137,7 -136,11 +137,7 @@@ static int lock_file(struct lock_file * lk->fd = open(lk->filename, O_RDWR | O_CREAT | O_EXCL, 0666); if (0 <= lk->fd) { if (!lock_file_list) { - signal(SIGINT, remove_lock_file_on_signal); - signal(SIGHUP, remove_lock_file_on_signal); - signal(SIGTERM, remove_lock_file_on_signal); - signal(SIGQUIT, remove_lock_file_on_signal); - signal(SIGPIPE, remove_lock_file_on_signal); + sigchain_push_common(remove_lock_file_on_signal); atexit(remove_lock_file); } lk->owner = getpid(); @@@ -155,11 -158,25 +155,25 @@@ return lk->fd; } + + NORETURN void unable_to_lock_index_die(const char *path, int err) + { + if (errno == EEXIST) { + die("Unable to create '%s.lock': %s.\n\n" + "If no other git process is currently running, this probably means a\n" + "git process crashed in this repository earlier. Make sure no other git\n" + "process is running and remove the file manually to continue.", + path, strerror(err)); + } else { + die("Unable to create '%s.lock': %s", path, strerror(err)); + } + } + int hold_lock_file_for_update(struct lock_file *lk, const char *path, int flags) { int fd = lock_file(lk, path, flags); if (fd < 0 && (flags & LOCK_DIE_ON_ERROR)) - die("unable to create '%s.lock': %s", path, strerror(errno)); + unable_to_lock_index_die(path, errno); return fd; }