From patchwork Sat Feb 18 08:36:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 13145504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BD01C636D7 for ; Sat, 18 Feb 2023 08:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbjBRIgn (ORCPT ); Sat, 18 Feb 2023 03:36:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjBRIgl (ORCPT ); Sat, 18 Feb 2023 03:36:41 -0500 Received: from mout.web.de (mout.web.de [212.227.15.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ECCE11E8B for ; Sat, 18 Feb 2023 00:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1676709384; i=l.s.r@web.de; bh=EkRgcNI5hPJFetKN7c7493/SwahnXB8kib2XRZyiUPo=; h=X-UI-Sender-Class:Date:Subject:To:References:Cc:From:In-Reply-To; b=R0lpsT5SpRS44D6e5iLqBQXrCsXJommPf2BW5bc8tBy97B7pAaKUtk8qobedMDEea gVGP7a0kMvasJOxrI9pGs/FmGC6k8cjWuiCS2hdlcJHVvuG/9bgebltQm4tERRu56Z xFBI5zAYgYKtFrxICbu/caU8Dw/gpas1+9o+Qr0V5Rz1s8efM8ca8/YOQ1DB4ZgKdh IkcRoaB05FEvGB6CXe+lsS3dwzJ+j2EM27C7sfmJANlFY6xvXhUU7W81HUmlDYGPMT 4Zm5qjX6JRKrYu95W5Aco40P/jebxvkaWwac5dKzpdAkRhJNQH2kpE8QcklpztZ+YU moCVE12pIKjqg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.29] ([79.203.21.51]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MIc7N-1pHWc12odB-00Ee1l; Sat, 18 Feb 2023 09:36:24 +0100 Message-ID: <91a73f5d-ca3e-6cb0-4ba3-38d703074ee6@web.de> Date: Sat, 18 Feb 2023 09:36:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH] archive: add --mtime To: Raul E Rangel , git@vger.kernel.org References: Content-Language: en-US Cc: Jeff King , Junio C Hamano , demerphq From: =?utf-8?q?Ren=C3=A9_Scharfe?= In-Reply-To: X-Provags-ID: V03:K1:ommirsfGKJH/G6xv5xkcp7OJRyC7bVczuDATCEaEPMvjAvHAcwg aas/nPSqk0U1AKEvs4T8LP5MAAHXwlTfrNeK4geuIXPEIvh00pT0kbakzRPs6gpD5CTfWWH 3MkcZh3UBCJt3cjbMoGV4Sv3NlXba2RkHbmvIyB9ua4MtwHlSqYFQzr7hMEBVw2Uv5sgmdH RgAVE0zjCvVUHRJUvbgFw== UI-OutboundReport: notjunk:1;M01:P0:8vIA1ZYP3BY=;IMa/ucLfRex0Qw5SlCw0CGyVU/l Uy41O2yrejiAyuAbmAlf6et5/hWHCaPO8vnZeaoG0D4SGnHmOHX38P89kUZ5iN1CCOAAKeaXb TAtmXuGVgv6JBJ65GRh4ce79qyil5vLmXPK7AxEXBoHSiu5sH6OYWD+JlPk3eQyzMJRQmlhLR lbrJJzKtZ/5AJ0ZtQ+Kjm5R2ewp/6bMkAxfpB/muNJXdO6CAaP5nE1wACp3qeE62IxpdqPyEP 32X/H0QOnQu4TCBncPl33qet+BXth/njkBXqyR4Uyjdreb91JQLdZzgTmQRpasQnomp1G7oWX n9yBbyDr5l1VZCUPQZ24mtzoUHSjzgOEgE/Q30PSXx2hXf0sTc5WKZgyb7hVL2QmDV+5Nqnn3 24l1qOber5hkilv/e/5wx22V6fG1qS5E6OKGqrTi+vn7hzNfoM6x4l070LixFrO6nfkun6dCy frbKUSMcM9pnPiNutYEq0SLWa0qBPme6Zq/IMjjUP8rMOYDvHl96BwL5iA6BUFIkhToAFZ0Se 7YAGfuA9mV4I5SbDM1TxW6HwvcisQvj6UxKtdePukB+LwzOFz2AeEbtBkHnuLMd9XTMAXgGGC rx0QChuuPtmhMIDnaX9YV9mHPA3fQYctxL6LiC7W0YtKK4qO/wVcByso1DOclWmzUj9MglcmI mo63kJ+OYHv5fV3iEyqidr3Wt9Bpw7ecxZ/HGCXzxeKHBjJQmF1K85KEqUWCTW1oA5n7HeLrk 6C2OmLgnbF8dauIgDcX8yWJ53JTtyozLtM747Y3NQfQ3APOaWjXFWGQf/tgg3tq5ufPv3Zbas 8bSejfPWkULL+gPPlfVK6eimGgyJ4YGQaz5TAb/asN6F9gL7vqlprs8uZWcDG8q5T8UZqgR+s aiHDo20p5aCCBXV5bqQo1Q4Ssig8iuf6I2Lz4Wmh+/yfXCcDuMCQOUOtZ9c/FjSCkGuQGeWRk nDY6wA== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 Suggested-by: demerphq Signed-off-by: René Scharfe --- Documentation/git-archive.txt | 5 +++++ archive.c | 7 +++++++ archive.h | 1 + t/t5000-tar-tree.sh | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+) -- 2.39.2 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 <>). +--mtime=