aboutsummaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-03-22 19:14:04 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-22 21:42:05 -0700
commit6fa8e6278b210bfa56fcb54ed38d2b485350e7c6 (patch)
tree823383ea9f4d4f82fb0a8b3be21a023b6ca0f95d /builtin-log.c
parentcd2ef591c8e753fe5295ac3c6f1dee481f00a185 (diff)
downloadgit-6fa8e6278b210bfa56fcb54ed38d2b485350e7c6.tar.gz
git-6fa8e6278b210bfa56fcb54ed38d2b485350e7c6.tar.xz
format-patch: move get_patch_filename() into log-tree
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 6a27ce695..4f438db4c 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -417,7 +417,6 @@ int cmd_log(int argc, const char **argv, const char *prefix)
}
/* format-patch */
-#define FORMAT_PATCH_NAME_MAX 64
static const char *fmt_patch_suffix = ".patch";
static int numbered = 0;
@@ -512,29 +511,6 @@ static int git_format_config(const char *var, const char *value, void *cb)
return git_log_config(var, value, cb);
}
-
-static void get_patch_filename(struct commit *commit, int nr,
- const char *suffix, struct strbuf *buf)
-{
- int suffix_len = strlen(suffix) + 1;
- int start_len = buf->len;
-
- strbuf_addf(buf, commit ? "%04d-" : "%d", nr);
- if (commit) {
- format_commit_message(commit, "%f", buf, DATE_NORMAL);
- /*
- * Replace characters at the end with the suffix if the
- * filename is too long
- */
- if (buf->len + suffix_len > FORMAT_PATCH_NAME_MAX + start_len)
- strbuf_splice(buf,
- start_len + FORMAT_PATCH_NAME_MAX - suffix_len,
- suffix_len, suffix, suffix_len);
- else
- strbuf_addstr(buf, suffix);
- }
-}
-
static FILE *realstdout = NULL;
static const char *output_directory = NULL;
static int outdir_offset;