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

271 Commits

Author SHA1 Message Date
Ross Smith II
814e5f8ab3
Replace cats with reads (passes all tests)
Signed-off-by: Ross Smith II <ross@smithii.com>
2021-02-23 17:51:44 -08:00
Tim Byrne
d11e094f7b
Merge pull request #303 from erijo/default-template-if 2021-02-15 12:57:45 -06:00
Tim Byrne
e6d7e6f174
Simplify return 2021-02-15 12:51:33 -06:00
Tim Byrne
999692fe5e
Merge pull request #307 from rasa/rs/simplify_parse_encrypt 2021-02-15 12:45:31 -06:00
Tim Byrne
a8e5b20021
Move shellcheck option below license 2021-02-15 12:39:27 -06:00
Tim Byrne
8ece22ab2a
Merge pull request #306 from rasa/rs/default-shellcheck 2021-02-15 12:33:22 -06:00
Tim Byrne
79f7aae073
Remove unnecessary [[ 2021-02-15 12:27:55 -06:00
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
Ross Smith II
84136a8633
Remove unneeded duplicate line 2021-01-11 17:17:11 -08:00
Ross Smith II
0c788ae020
Simplify parse_encrypt by exiting early
if encrypt file doesn't exist.

Signed-off-by: Ross Smith II <ross@smithii.com>
2021-01-10 19:07:21 -08:00
Ross Smith II
fecbb315df
Add 'shellcheck shell=bash' as the default
See https://github.com/koalaman/shellcheck/wiki/Directive#shell

Signed-off-by: Ross Smith II <ross@smithii.com>
2021-01-10 18:49:28 -08:00
Erik Flodin
e2ed647c2a
Tighten up parsing of if-statement in default template
Require space after if and an ending %} after the condition.
2021-01-10 20:53:12 +01: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