*/
#include "cache.h"
+#include "config.h"
#include "builtin.h"
#include "commit.h"
#include "diff.h"
*/
static int read_ancestry(const char *graft_file)
{
- FILE *fp = fopen(graft_file, "r");
+ FILE *fp = fopen_or_warn(graft_file, "r");
struct strbuf buf = STRBUF_INIT;
if (!fp)
return -1;
return 0;
}
-struct blame_entry *blame_entry_prepend(struct blame_entry *head,
- long start, long end,
- struct blame_origin *o)
-{
- struct blame_entry *new_head = xcalloc(1, sizeof(struct blame_entry));
- new_head->lno = start;
- new_head->num_lines = end - start;
- new_head->suspect = o;
- new_head->s_lno = start;
- new_head->next = head;
- blame_origin_incref(o);
- return new_head;
-}
-
int cmd_blame(int argc, const char **argv, const char *prefix)
{
struct rev_info revs;
blame_date_width = sizeof("2006-10-19");
break;
case DATE_RELATIVE:
- /* TRANSLATORS: This string is used to tell us the maximum
- display width for a relative timestamp in "git blame"
- output. For C locale, "4 years, 11 months ago", which
- takes 22 places, is the longest among various forms of
- relative timestamps, but your language may need more or
- fewer display columns. */
+ /*
+ * TRANSLATORS: This string is used to tell us the
+ * maximum display width for a relative timestamp in
+ * "git blame" output. For C locale, "4 years, 11
+ * months ago", which takes 22 places, is the longest
+ * among various forms of relative timestamps, but
+ * your language may need more or fewer display
+ * columns.
+ */
blame_date_width = utf8_strwidth(_("4 years, 11 months ago")) + 1; /* add the null */
break;
case DATE_NORMAL: