Skip to content

Commit bbe8a37

Browse files
committed
Merge branch 'jc/signed-fast-export-is-experimental'
Mark a new feature added during this cycle as experimental and fix its default so that existing users of the fast-export command is not broken. * jc/signed-fast-export-is-experimental: fast-export: --signed-commits is experimental
2 parents 4f91e60 + 0b4c6ba commit bbe8a37

File tree

5 files changed

+16
-30
lines changed

5 files changed

+16
-30
lines changed

Documentation/RelNotes/2.50.0.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ Performance, Internal Implementation, Development Support etc.
102102
* "git fsck" becomes more careful when checking the refs.
103103
104104
* "git fast-export | git fast-import" learns to deal with commit and
105-
tag objects with embedded signatures a bit better.
105+
tag objects with embedded signatures a bit better. This is highly
106+
experimental and the format of the data stream may change in the
107+
future without compatibility guarantees.
106108
107109
* The code paths to check whether a refname X is available (by seeing
108110
if another ref X/Y exists, etc.) have been optimized.

Documentation/git-fast-export.adoc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ resulting tag will have an invalid signature.
4646

4747
--signed-commits=(verbatim|warn-verbatim|warn-strip|strip|abort)::
4848
Specify how to handle signed commits. Behaves exactly as
49-
'--signed-tags', but for commits. Default is 'abort'.
49+
'--signed-tags', but for commits. Default is 'strip', which
50+
is the same as how earlier versions of this command without
51+
this option behaved.
5052
+
51-
Earlier versions this command that did not have '--signed-commits'
52-
behaved as if '--signed-commits=strip'. As an escape hatch for users
53-
of tools that call 'git fast-export' but do not yet support
54-
'--signed-commits', you may set the environment variable
55-
'FAST_EXPORT_SIGNED_COMMITS_NOABORT=1' in order to change the default
56-
from 'abort' to 'warn-strip'.
53+
NOTE: This is highly experimental and the format of the data stream may
54+
change in the future without compatibility guarantees.
5755

5856
--tag-of-filtered-object=(abort|drop|rewrite)::
5957
Specify how to handle tags whose tagged object is filtered out.

Documentation/git-fast-import.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ that signs the commit data.
523523
Here <alg> specifies which hashing algorithm is used for this
524524
signature, either `sha1` or `sha256`.
525525

526+
NOTE: This is highly experimental and the format of the data stream may
527+
change in the future without compatibility guarantees.
528+
526529
`encoding`
527530
^^^^^^^^^^
528531
The optional `encoding` command indicates the encoding of the commit

builtin/fast-export.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ enum sign_mode { SIGN_ABORT, SIGN_VERBATIM, SIGN_STRIP, SIGN_WARN_VERBATIM, SIGN
3939

4040
static int progress;
4141
static enum sign_mode signed_tag_mode = SIGN_ABORT;
42-
static enum sign_mode signed_commit_mode = SIGN_ABORT;
42+
static enum sign_mode signed_commit_mode = SIGN_STRIP;
4343
static enum tag_of_filtered_mode { TAG_FILTERING_ABORT, DROP, REWRITE } tag_of_filtered_mode = TAG_FILTERING_ABORT;
4444
static enum reencode_mode { REENCODE_ABORT, REENCODE_YES, REENCODE_NO } reencode_mode = REENCODE_ABORT;
4545
static int fake_missing_tagger;
@@ -1269,7 +1269,6 @@ int cmd_fast_export(int argc,
12691269
const char *prefix,
12701270
struct repository *repo UNUSED)
12711271
{
1272-
const char *env_signed_commits_noabort;
12731272
struct rev_info revs;
12741273
struct commit *commit;
12751274
char *export_filename = NULL,
@@ -1327,10 +1326,6 @@ int cmd_fast_export(int argc,
13271326
if (argc == 1)
13281327
usage_with_options (fast_export_usage, options);
13291328

1330-
env_signed_commits_noabort = getenv("FAST_EXPORT_SIGNED_COMMITS_NOABORT");
1331-
if (env_signed_commits_noabort && *env_signed_commits_noabort)
1332-
signed_commit_mode = SIGN_WARN_STRIP;
1333-
13341329
/* we handle encodings */
13351330
git_config(git_default_config, NULL);
13361331

t/t9350-fast-export.sh

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -299,22 +299,10 @@ test_expect_success GPG 'set up signed commit' '
299299
300300
'
301301

302-
test_expect_success GPG 'signed-commits default' '
303-
304-
sane_unset FAST_EXPORT_SIGNED_COMMITS_NOABORT &&
305-
test_must_fail git fast-export --reencode=no commit-signing &&
306-
307-
FAST_EXPORT_SIGNED_COMMITS_NOABORT=1 git fast-export --reencode=no commit-signing >output 2>err &&
308-
! grep ^gpgsig output &&
309-
grep "^encoding ISO-8859-1" output &&
310-
test -s err &&
311-
sed "s/commit-signing/commit-strip-signing/" output | (
312-
cd new &&
313-
git fast-import &&
314-
STRIPPED=$(git rev-parse --verify refs/heads/commit-strip-signing) &&
315-
test $COMMIT_SIGNING != $STRIPPED
316-
)
317-
302+
test_expect_success GPG 'signed-commits default is same as strip' '
303+
git fast-export --reencode=no commit-signing >out1 2>err &&
304+
git fast-export --reencode=no --signed-commits=strip commit-signing >out2 &&
305+
test_cmp out1 out2
318306
'
319307

320308
test_expect_success GPG 'signed-commits=abort' '

0 commit comments

Comments
 (0)