diff options
author | René Scharfe <l.s.r@web.de> | 2023-02-18 11:36:23 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-18 20:29:13 +0300 |
commit | fd2da4b1ea871df317322f33e82cb3aa1f95ee10 (patch) | |
tree | 07e6b1abea1b40a40be16cb7537b1ee12cdb99a2 /Documentation | |
parent | d9d677b2d8cc5f70499db04e633ba7a400f64cbf (diff) |
archive: add --mtime
Allow users to specify the modification time of archive entries. The
new option --mtime uses approxidate() to parse a time specification and
overrides the default of using the current time for trees and the commit
time for tags and commits. It can be used to create a reproducible
archive for a tree, or to use a specific mtime without creating a commit
with GIT_COMMITTER_DATE set.
This implementation doesn't support the negated form of the new option,
i.e. --no-mtime is not accepted. It is not possible to have no mtime at
all. We could use the Unix epoch or revert to the default behavior, but
since negation is not necessary for the intended use it's left undecided
for now.
Requested-by: Raul E Rangel <rrangel@chromium.org>
Suggested-by: demerphq <demerphq@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-archive.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt index 60c040988b..6bab201d37 100644 --- a/Documentation/git-archive.txt +++ b/Documentation/git-archive.txt @@ -86,6 +86,11 @@ cases, write an untracked file and use `--add-file` instead. Look for attributes in .gitattributes files in the working tree as well (see <<ATTRIBUTES>>). +--mtime=<time>:: + Set modification time of archive entries. Without this option + the committer time is used if `<tree-ish>` is a commit or tag, + and the current time if it is a tree. + <extra>:: This can be any options that the archiver backend understands. See next section. |