Skip to content

Commit d08f226

Browse files
committed
Merge branch 'main' into update-github-workflow-tests
* main: (27 commits) Add or update references to me (James Murty) as project maintainer Update long-outdated copyright notices Note performance improvements from #193 in changelog Remove repeated lines in comments Add tests for feature: detect incorrect password on init Improve name of function that counts dirty files, and do all the needed work in the function handle --force when checking for incorrect password performance: don't create subshells Document in changelog improvements by weichunglee in PR #197 fix logic for version checking in pre_commit, fix empty files always failing validate_file Update ongoing dev version to 2.3.2-pre Release 2.3.1 Warn when password is probably incorrect with error message and return code #182 Fix --export-gpg command to properly include cipher in exported .asc file Fail with error when an empty password is provided to the -p or --password options #188 Make --upgrade safer by failing fast if transcrypt config cannot be read #189 Remove hard dependency on `xxd` which can be onerous, fall back to `printf` or `perl` instead #181 Don't set global Git config when running tests Make ongoing dev version 2.3.1-pre Release 2.3.0 ...
2 parents 90207f1 + d35abf2 commit d08f226

File tree

12 files changed

+221
-48
lines changed

12 files changed

+221
-48
lines changed

CHANGELOG.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,33 @@ system, you must also run the `--upgrade` command in each repository:
3434

3535
## [Unreleased]
3636

37+
### Changed
38+
39+
- Improve check for incorrect password to avoid false report when transcrypt
40+
init is run with --force in a repo containing dirty files & add tests (#196)
41+
- Greatly improve performance in a repository with many files for pre-commit
42+
safety check, encrypted file listing, and showing raw file (#193)
43+
44+
### Fixed
45+
46+
- Fix pre-commit hook to use "fast" multi-threaded mode for Bash versions 5+ as
47+
well as 4.4+, and even if some encrypted files are empty (#197)
48+
49+
## [2.3.1] - 2025-02-24
50+
51+
### Fixed
52+
53+
- Warn when password is probably incorrect by returning an error message and
54+
return code if repo has dirty files after init (#182)
55+
- Fail with error when an empty password is provided to the -p or --password
56+
options (#188)
57+
- Fix handling of double-quotes in encrypted file names (#173)
58+
- Make --upgrade safer by failing fast if transcrypt config cannot be read
59+
(#189)
60+
- Fix --export-gpg command to properly include cipher in exported .asc file
61+
62+
## [2.3.0] - 2024-09-10
63+
3764
### Added
3865

3966
- Add contexts feature that lets you encrypt different sets of files with
@@ -47,11 +74,18 @@ system, you must also run the `--upgrade` command in each repository:
4774

4875
- Prevent `cd` commands printing out excess details when `CDPATH` is set (#156)
4976
- Fix `--flush` command to work with contexts (#175)
77+
- Fix unbound variable error using `$GIT_REFLOG_ACTION` (issue #150)
5078

5179
### Changed
5280

81+
- Remove hard dependency on `xxd` which is often a heavy requirement because it
82+
is only available with Vim on some platforms. Fall back to `printf` with full
83+
%b support or `perl` when either of these are available, and only require
84+
`xxd` when it is the only viable option (#181)
5385
- Prevent global options set in `GREP_OPTIONS` enviroment variable from
5486
breaking transcrypt's use of grep (#166)
87+
- If `CDPATH` is set then cd will print the path (#156)
88+
- Centralise load and save of password into functions (#141)
5589

5690
## [2.2.3] - 2023-03-09
5791

@@ -318,7 +352,9 @@ Since the v0.9.7 release, these are the notable improvements made to transcrypt:
318352

319353
## [0.9.4] - 2014-03-03
320354

321-
[unreleased]: https://github.com/elasticdog/transcrypt/compare/v2.2.3...HEAD
355+
[unreleased]: https://github.com/elasticdog/transcrypt/compare/v2.3.1...HEAD
356+
[2.3.1]: https://github.com/elasticdog/transcrypt/compare/v2.3.0...v2.3.1
357+
[2.3.0]: https://github.com/elasticdog/transcrypt/compare/v2.2.3...v2.3.0
322358
[2.2.3]: https://github.com/elasticdog/transcrypt/compare/v2.2.2...v2.2.3
323359
[2.2.2]: https://github.com/elasticdog/transcrypt/compare/v2.2.1...v2.2.2
324360
[2.2.1]: https://github.com/elasticdog/transcrypt/compare/v2.2.0...v2.2.1

INSTALL.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The requirements to run transcrypt are minimal:
66
- Git
77
- OpenSSL
88
- `column` command (on Ubuntu/Debian install `bsdmainutils`)
9-
- `xxd` command if using OpenSSL version 3
10-
(on Ubuntu/Debian is included with `vim`)
9+
- if using OpenSSL 3+ one of: `xxd` (on Ubuntu/Debian is included with `vim`)
10+
or `printf` command (with %b directive) or `perl`
1111

1212
...and optionally:
1313

@@ -74,4 +74,3 @@ collection:
7474
or via the packages system:
7575

7676
# `pkg install -y security/transcrypt`
77-

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Copyright (c) 2014-2019, Aaron Bull Schaefer <aaron@elasticdog.com>
1+
Copyright (c) 2019-2025, James Murty <james@murty.co>
2+
Copyright (c) 2014-2020, Aaron Bull Schaefer <aaron@elasticdog.com>
23
Copyright (c) 2011, Woody Gilk <woody.gilk@gmail.com>
34

45
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ The requirements to run transcrypt are minimal:
5656
- Git
5757
- OpenSSL
5858
- `column` and `hexdump` commands (on Ubuntu/Debian install `bsdmainutils`)
59-
- `xxd` command if using OpenSSL version 3
60-
(on Ubuntu/Debian is included with `vim`)
59+
- if using OpenSSL 3+ one of: `xxd` (on Ubuntu/Debian is included with `vim`)
60+
or `printf` command (with %b directive) or `perl`
6161

6262
...and optionally:
6363

@@ -344,6 +344,7 @@ to encrypt a file \_top-secret* in a "super" context:
344344
transcrypt is provided under the terms of the
345345
[MIT License](https://en.wikipedia.org/wiki/MIT_License).
346346

347+
Copyright &copy; 2019-2025, James Murty <mailto:james@murty.co>.
347348
Copyright &copy; 2014-2020, [Aaron Bull Schaefer](mailto:aaron@elasticdog.com).
348349

349350
## Contributing

contrib/bash/transcrypt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ _transcrypt() {
2121
COMPREPLY=()
2222
cur="${COMP_WORDS[COMP_CWORD]}"
2323
prev="${COMP_WORDS[COMP_CWORD-1]}"
24-
opts="-c -p -y -d -r -f -F -u -l -s -e -i -v -h \
25-
--cipher --password --set-openssl-path --yes --display --rekey --flush-credentials --force --uninstall --upgrade --list --show-raw --export-gpg --import-gpg --version --help"
24+
opts="-c -p -y -d -r -f -F -u -l -s -e -i -C -v -h \
25+
--cipher --password --set-openssl-path --yes --display --rekey --flush-credentials --force --uninstall --upgrade --list --show-raw --export-gpg --import-gpg --context --list-contexts --version --help"
2626

2727
case "${prev}" in
2828
-c | --cipher)

contrib/packaging/pacman/PKGBUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Maintainer: Aaron Bull Schaefer <aaron@elasticdog.com>
1+
# Maintainer: James Murty <james@murty.co>
22
pkgname=transcrypt
3-
pkgver=2.3.0-pre
3+
pkgver=2.3.2-pre
44
pkgrel=1
55
pkgdesc='A script to configure transparent encryption of files within a Git repository'
66
arch=('any')

man/transcrypt.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,8 @@ If the origin repository has just rekeyed, all clones should flush their transcr
114114
.SH "AUTHOR"
115115
Aaron Bull Schaefer <aaron@elasticdog\.com>
116116
.
117+
.SH "MAINTAINER"
118+
James Murty <james@murty\.co>
119+
.
117120
.SH "SEE ALSO"
118121
enc(1), gitattributes(5)

man/transcrypt.1.ronn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ For example, to encrypt a file 'top-secret' in a "super" context:
145145

146146
Aaron Bull Schaefer &lt;aaron@elasticdog.com&gt;
147147

148+
## MAINTAINER
149+
150+
James Murty &lt;james@murty.co&gt;
151+
148152
## SEE ALSO
149153

150154
enc(1), gitattributes(5)

tests/_test_helper.bash

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ function init_git_repo {
77
echo "WARNING: Test repo already exists at $BATS_TEST_DIRNAME/.git"
88
else
99
# Configure "main" as the default branch name
10-
git config --global init.defaultBranch main
10+
git config --local init.defaultBranch main
1111
# Initialise test git repo at the same path as the test files
1212
git init "$BATS_TEST_DIRNAME"
1313
git checkout -b main
1414
# Tests will fail if name and email aren't set
15-
git config user.name "John Doe"
16-
git config user.email johndoe@example.com
15+
git config --local user.name "John Doe"
16+
git config --local user.email johndoe@example.com
1717
# Flag test git repo as 100% the test one, for safety before later removal
1818
touch "$BATS_TEST_DIRNAME"/.git/repo-for-transcrypt-bats-tests
1919
fi
@@ -43,6 +43,10 @@ function init_transcrypt {
4343
"$BATS_TEST_DIRNAME"/../transcrypt --cipher=aes-256-cbc --password='abc 123' --yes
4444
}
4545

46+
function uninstall_transcrypt {
47+
"$BATS_TEST_DIRNAME"/../transcrypt --uninstall --yes
48+
}
49+
4650
function encrypt_named_file {
4751
filename="$1"
4852
content=$2

tests/test_contexts.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function teardown {
7676
[[ $(git config --get diff.crypt.binary) = "true" ]]
7777
[[ $(git config --get merge.renormalize) = "true" ]]
7878

79-
[[ "$(git config --get alias.ls-crypt)" = "!git -c core.quotePath=false ls-files | git -c core.quotePath=false check-attr --stdin filter | awk 'BEGIN { FS = \":\" }; / crypt/{ print \$1 }'" ]]
79+
[[ "$(git config --get alias.ls-crypt)" = '!"$(git config transcrypt.crypt-dir 2>/dev/null || printf %s/crypt ""$(git rev-parse --git-dir)"")"/transcrypt --list' ]]
8080
}
8181

8282
@test "init: show extra context details in --display" {
@@ -216,7 +216,7 @@ function teardown {
216216
[ "${lines[1]}" = "$SUPER_SECRET_CONTENT_ENC" ]
217217
}
218218

219-
@test "contexts: git ls-crypt lists encrypted file for all contexts" {
219+
@test "contexts: git ls-crypt lists encrypted files for all contexts" {
220220
encrypt_named_file sensitive_file "$SECRET_CONTENT"
221221
encrypt_named_file super_sensitive_file "$SECRET_CONTENT" "super-secret"
222222

@@ -226,14 +226,14 @@ function teardown {
226226
[ "${lines[1]}" = "super_sensitive_file" ]
227227
}
228228

229-
@test "contexts: git ls-crypt-default lists encrypted file for only 'default' context" {
229+
@test "contexts: git ls-crypt-default lists encrypted files for all contexts" {
230230
encrypt_named_file sensitive_file "$SECRET_CONTENT"
231231
encrypt_named_file super_sensitive_file "$SECRET_CONTENT" "super-secret"
232232

233233
run git ls-crypt-default
234234
[ "$status" -eq 0 ]
235235
[ "${lines[0]}" = "sensitive_file" ]
236-
[ "${lines[1]}" = "" ]
236+
[ "${lines[1]}" = "super_sensitive_file" ]
237237
}
238238

239239
@test "contexts: git ls-crypt-super-secret lists encrypted file for only 'super-secret' context" {

0 commit comments

Comments
 (0)