Jeff King <peff@xxxxxxxx> writes: > There's a slight bit of trickiness there. We may already be > ... > After writing the extended header, we munge the timestamp in > the ustar headers to the maximum-allowable size. This is > wrong, but it's the least-wrong thing we can provide to a > tar implementation that doesn't understand pax headers (it's > also what GNU tar does). The above looks very sensible design, and its implementation is surprisingly compact. Very nicely done. > Helped-by: René Scharfe <l.s.r@xxxxxx> > Signed-off-by: Jeff King <peff@xxxxxxxx> > --- > archive-tar.c | 16 +++++++++++++--- > t/t5000-tar-tree.sh | 4 ++-- > 2 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/archive-tar.c b/archive-tar.c > index 274bdfa..0bb164c 100644 > --- a/archive-tar.c > +++ b/archive-tar.c > @@ -317,7 +317,18 @@ static int write_global_extended_header(struct archiver_args *args) > unsigned int mode; > int err = 0; > > - strbuf_append_ext_header(&ext_header, "comment", sha1_to_hex(sha1), 40); > + if (sha1) > + strbuf_append_ext_header(&ext_header, "comment", > + sha1_to_hex(sha1), 40); > + if (args->time > 077777777777UL) { > + strbuf_append_ext_header_uint(&ext_header, "mtime", > + args->time); > + args->time = 077777777777UL; > + } > + > + if (!ext_header.len) > + return 0; Another symbolic constant to explain this, e.g. TAR_TIME_LIMIT, may want to exist. Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html