1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2024-10-27 20:34:27 +00:00
Commit Graph

260 Commits

Author SHA1 Message Date
Tim Byrne
88ee3f09fb
Merge pull request #301 from erijo/relative-path 2021-02-15 12:11:21 -06:00
Tim Byrne
e6cfd39bbc
Remove mktemp dependency 2021-02-03 22:46:48 -06:00
Erik Flodin
accec694f5
Deinit submodules before removing the repo
when forcing init/clone to happen.
2021-01-08 22:21:35 +01:00
Erik Flodin
f45e66d4da
Rework clone
Instead of doing work to find the default branch just to be able to
set up the repository before doing a fetch, do a "git clone" and let
git handle it.

Use -c core.sharedrepository=0600 to get the same result as
--shared=0600 passed to init.

Use --separate-git-dir to get the git directory in $YADM_REPO. Use a
temporary dir as work tree and remove it right after the clone is
done.

When the clone is done, iterate over all missing files in $YADM_WORK
and perform a checkout. If local files exists that differ compared
with the cloned ones the local files are left intact and the user is
instructed to deal with the conflicts.
2021-01-08 22:05:46 +01:00
Erik Flodin
a321c88c7c
Support passing relative paths to --yadm-* and -w
Relative paths are expanded relative the current working dir as
expected.
2021-01-08 21:45:55 +01:00
Tim Byrne
a5b1067e02
Update version number and update documentation
* Fix parsing by sh (#299)
2021-01-07 10:49:26 -06:00
Tim Byrne
b32025bcc3
Fix parsing by sh (#299) 2021-01-07 10:46:06 -06:00
Tim Byrne
afab29c5fc
Update version number and update documentation
* Improve handling of submodules at upgrade (#284, #285, #293)
* Improve Zsh completions (#292, #298)
* Use stderr for error messages (#297)
2021-01-07 09:24:11 -06:00
Erik Flodin
6378fe3073
Print errors to stderr
This makes it possible to run e.g. "yadm -Y foo introspect repo
2>/dev/null" and get an empty output instead of getting the error
message about foo not being fully qualified.
2021-01-05 21:57:32 +01:00
Erik Flodin
5818eeb9dd
Change handling of submodules at upgrade
Start with doing "submodule absorbgitdirs" as otherwise "submodule
deinit" will fail if a module has been cloned first and later added as
a submodule (as it will then contain the .git dir instead of it being
under the superprojects .git dir).

Then try to deinit the submodules before moving the repo and abort the
upgrade if it fails for any submodule. Then do the move and finally
initialize the submodules that were initialized before the upgrade.

See #285
2021-01-04 18:31:24 +01:00
Tim Byrne
dcfa55ce49
Update version number and update documentation
* Support encryption with OpenSSL (#138)
* Support "include" directive in built-in template processor (#255)
* Support extensions for alternate files and templates (#257)
* Improve support for default branches (#231, #232)
* Add --version and --help as yadm internal commands (#267)
* Improve support for XDG base directory specification
* Use XDG_DATA_HOME used for encrypted data and repository (#208)
* Default repo is now ~/.local/share/yadm/repo.git
* Default encrypted archive is now ~/.local/share/yadm/archive
* Improve shell completions (#238, #274, #275)
* Remove support for YADM_COMPATIBILITY=1 (#242)
* Remove deprecated option cygwin-copy
* Fix template mode inheritance on FreeBSD (#243, #246)
* Fix hook execution under MinGW (#150)
* Improve compatibility with Oil shell (#210)
2020-12-30 16:59:58 -06:00
Tim Byrne
7c1192ae2e
Support upgrading from version 1 repos
* yadm upgrade now updates legacy paths created by yadm 1
* Warnings are issued for invalid alternates again
2020-12-30 14:19:49 -06:00
Erik Flodin
8a3fb1a518
Make yadm enter work with zsh and tramp
zle must be disabled when using tramp, otherwise it doesn't work.
2020-12-29 23:58:05 +01:00
Erik Flodin
5e9c5cf66c
Issue legacy path warnings to stderr
To make it possible to ignore the warning e.g. when running yadm
introspect repo in the bash completion.
2020-12-27 22:33:15 +01:00
Tim Byrne
df2ff5ec70
Remove deprecated option cygwin-copy 2020-12-26 12:34:58 -06:00
Tim Byrne
d45d53ff39
Fix typo 2020-12-23 10:40:36 -06:00
Tim Byrne
f9337101ee
Adjust formatting
Also use `{...;}` instead of `(...)`
2020-12-22 11:51:46 -06:00
Tim Byrne
c2cb41cdd5
Merge pull request #150 from addshore/patch-1 2020-12-22 11:17:05 -06:00
Tim Byrne
7f23dde912
Merge pull request #210 from abathur/fix_regexp_space 2020-12-22 11:01:51 -06:00
Tim Byrne
d298b42653
Merge pull request #257 from erijo/extension 2020-12-22 10:08:30 -06:00
Tim Byrne
999e0f11f8
Merge pull request #259 from erijo/cleanups 2020-12-22 09:54:01 -06:00
Tim Byrne
56e48947d0
Merge pull request #271 from rasa/patch-3 2020-12-22 09:41:06 -06:00
Tim Byrne
c4b419d98e
Add --version and --help as yadm internal commands (#267) 2020-12-21 17:06:14 -06:00
Tim Byrne
e3d2ea2863
Combine local and assignments where appropriate 2020-12-21 17:06:14 -06:00
Ross Smith II
e2d9c06168
Fix paths in yadm help output
For completeness, I added the bootstrap script too.
2020-12-18 09:44:01 -08:00
Tim Byrne
80d8949850
Update regex to match horizontal white space only 2020-12-06 22:36:12 -06:00
Tim Byrne
4b5f16d73a
Improve support for default branches (#231, #232)
Unless a branch is specified, the default remote HEAD is used during
clone. Also a local master branch is not created if it is not the remote
HEAD.
2020-12-06 13:23:25 -06:00
Tim Byrne
4cb13d5d08
Remove unnecessary LEGACY_WARNING_ISSUED flag 2020-11-25 23:18:26 -06:00
Tim Byrne
13a3cdc8a8
Remove reporting of invalid alts 2020-11-25 23:18:25 -06:00
Tim Byrne
7997dc9a3d
Update upgrade
Upgrade will only move 2.0.0 paths to 3.0.0 standards
2020-11-25 23:18:25 -06:00
Tim Byrne
fc66b6b71b
Support XDG_DATA_HOME (#208)
* Create a YADM_DATA base (that is the source for repo & archive)
* Add --yadm-data to override
* Default YADM_DATA will be determined by XDG_DATA_HOME
2020-11-22 17:09:44 -06:00
Erik Flodin
f22c4d04cc
Add support for the extension "condition"
This special condition doesn't affect the selection process and is only
supported to support syntax highlighting and language detection for alt files
as reported in #239.
2020-10-25 10:41:52 +01:00
Erik Flodin
4e1fb0166e
Reuse if pattern in template_default's condition pattern 2020-10-18 22:40:06 +02:00
Erik Flodin
3ce59314f5
Remove unused function alt_past_linking
Unused as of b19c78b8
2020-10-18 22:20:06 +02:00
Tim Byrne
b19c78b8e2
Remove support for YADM_COMPATIBILITY=1 (#242) 2020-10-17 17:41:09 -05:00
Erik Flodin
9bcf070dfe
Add support for including files using the default template processor
The syntax is '{% include "file" %}' where file is either an absolute path or a
path relative to the current template file's directory.

Variables in the included file will be replaced as for the main template. But
the included file can't include files itself.
2020-10-12 16:13:50 +02:00
Tim Byrne
2e035d9e05
Refactor encryption option generation 2020-10-07 01:21:55 -05:00
Tim Byrne
c2a4d9cb27
Use OPENSSL_OPTS for encryption too 2020-10-05 22:32:18 -05:00
Tim Byrne
59c60a4675
Change default archive name to "archive" 2020-09-25 12:10:34 -05:00
Tim Byrne
05ae6f0257
Add config yadm.openssl-old
The newer versions (OpenSSL 1.1.1 or LibreSSL 2.9.1) support the pbkdf2
key derivation function, while older versions do not. In addition the
new versions have changed the default digest to SHA256 instead of MD5.

Files encrypted with older versions would throw warnings about
deprecated key derivation used files encrypted with newer versions +
pbkdf2 would not be decryptable using older versions These problems
matter, when many users maintain their dotfiles across different systems
with different levels of OpenSSL support.

A new boolean config option has been added, yadm.openssl-old

* If false, use options -pbkdf2 -iter 100000 -md sha512
* If true, use options -md md5 (and if decrypting with newer versions
  warnings will be printed)
2020-09-25 10:04:18 -05:00
Tim Byrne
47d4ea5f7e
Merge branch 'feature/alt-cyphers-138' into develop 2020-09-21 21:02:07 -05:00
Tim Byrne
0d94dfd8d7
Truncate using parameter expansion
I'm not completely sure truncation is actually needed, but regardless
this removes the dependency on `cut`.
2020-08-20 13:08:19 -05:00
Adam Jimerson
a13311feac
Adjust file mode check for BSD based systems
Adjusts the file mode check for BSD based systems as default BSD stat
uses "-f '%p'" to report the file mode. Also since `stat -p '%p'
"$filename"` reports more information than just read, write, execute
perms, pipe the output through `cut` to grab only the last three digits.

Signed-off-by: Adam Jimerson <vendion@gmail.com>
2020-08-19 09:36:14 -04:00
Tim Byrne
7628a1b61d
Release 2.5.0
Update version number and update documentation

* Support for transcrypt (#197)
* Support ESH templates (#220)
* Preserve file mode of template (#193)
* Fish shell completions (#224)
* Fix alt processing when worktree is `/` (#198)
* Assert config directory if missing (#226, #227)
* Documentation improvements (#229)
2020-08-09 15:54:31 -05:00
Tim Byrne
6098f76616
Set default cipher in only one place 2020-07-17 14:43:29 -05:00
Tim Byrne
d9adc80209
Adjust indent 2020-07-17 14:42:58 -05:00
Tim Byrne
4ae504c533
Merge alternative cyphers changes into develop 2020-07-17 14:07:10 -05:00
Tim Byrne
24e3dab328
Fix alternate file processing when worktree is / (#198) 2020-07-17 11:17:58 -05:00
Tim Byrne
102ba5d558
Preserve file mode of template (#193)
Any processed templates will inherit the file mode of the source
template.
2020-07-11 21:52:28 -05:00
Tim Byrne
6654e29c62
Merge pull request #220 2020-07-08 16:17:24 -05:00