From e0ffb24877d4530208905512f7c91dd8d71e2c95 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 9 Sep 2006 22:42:02 -0700 Subject: Add --verbose to git-archive And teach backends about it. Signed-off-by: Junio C Hamano (cherry picked from 9e2c44a2893ae90944a0b7c9f40a9d22b759b5c0 commit) --- builtin-tar-tree.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'builtin-tar-tree.c') diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c index e8e492fa0f..f2679a8637 100644 --- a/builtin-tar-tree.c +++ b/builtin-tar-tree.c @@ -22,6 +22,7 @@ static unsigned long offset; static time_t archive_time; static int tar_umask; +static int verbose; /* writes out the whole block, but only if it is full */ static void write_if_needed(void) @@ -169,6 +170,8 @@ static void write_entry(const unsigned char *sha1, struct strbuf *path, mode = 0100666; sprintf(header.name, "%s.paxheader", sha1_to_hex(sha1)); } else { + if (verbose) + fprintf(stderr, "%.*s\n", path->len, path->buf); if (S_ISDIR(mode)) { *header.typeflag = TYPEFLAG_DIR; mode = (mode | 0777) & ~tar_umask; @@ -385,6 +388,7 @@ int write_tar_archive(struct archiver_args *args) git_config(git_tar_config); archive_time = args->time; + verbose = args->verbose; if (args->commit_sha1) write_global_extended_header(args->commit_sha1); -- cgit v1.2.3