1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2025-06-13 13:03:58 +00:00
Commit Graph

120 Commits

Author SHA1 Message Date
Ross Smith II
4e295e3545 Set perms recursively 2019-02-08 14:12:55 -08:00
Ross Smith II
509b9d2c01 Merge remote-tracking branch 'origin/patch-2' 2018-08-21 14:47:17 -07:00
Ross Smith II
8061c5ead6
Remove dependency on hostname 2018-08-16 13:33:24 -07:00
Ross Smith II
f5af9cd947 Merge branch 'rasa/fix-brace-expansion' 2018-03-10 11:09:39 -08:00
Ross Smith II
ebc4ed01a9 Merge branch 'rasa/ignore-encrypted-files' 2018-03-10 11:06:00 -08:00
Ross Smith II
ec873d1ecd Add yadm ignore to ignore encrypted files
The new ignore command does the following:

1. Scans ~/.yadm/encrypt and adds its entries to ~/.gitignore.
   If  ~/.gitignore doesn't exist, it's created. Any lines that begin
   with # or ! are skipped, as well. If the entry is already in
   ~/.gitignore (either as /file, !/file, file, or !file), it's
   skipped. While 'file' and '!file' could lead to unintended skips,
   not including them would more likely lead to unintended skips.

2. Scans the list of actual files found that match ~/.yadm/encrypt
   entries, and adds them to ~/.gitignore. For example, if
   ~/.yadm/encrypt contains .ssh/config##Linux, and .ssh/config exists,
   it adds .ssh/config to ~/.gitignore, unless the entry is already in
   ~/.gitignore (either as /file, !/file, file, or !file).

- Since ~/.yadm/encrypt entries are rooted in $YADM_WORK without a
  leading slash, a leading slash is added to the ~/.gitignore entries
  to provide matching equivalency.

- A new option --yadm-ignore allows the user to override the location
  of ~/.gitignore.

- Uses sed to trim any leading or trailing whitespace when reading
  ~/.yadm/encrypt and ~/.gitignore.
2018-03-10 11:01:48 -08:00
Ross Smith II
d45344dbe2 Fix brace expansion (fixes #106) 2018-03-08 19:22:28 -08:00
Ross Smith II
6394110201 Merge branch 'rasa-dont-encrypt-nothingness' 2018-03-07 15:52:20 -08:00
Ross Smith II
96f127a859 Merge branch 'rasa-dotglob' 2018-03-07 15:52:12 -08:00
Ross Smith II
f57a01b0d4 Don't encrypt nothingness 2018-03-07 15:48:15 -08:00
Ross Smith II
5bb192a869 Have yadm encrypt match dotfiles (like .gitignore does) 2018-03-07 15:29:21 -08:00
Ross Smith II
0362f1bfe6 Merge branch 'rasa-add-mingw-msys-support' 2018-03-05 07:03:06 -08:00
Ross Smith II
54f7cbcebe Fix OS name match for Cygwin/Msys 2018-03-05 07:02:46 -08:00
Ross Smith II
6ae3ef1d03 Merge branch 'rasa-relative-symlinks' 2018-03-04 07:39:10 -08:00
Ross Smith II
6328fac5d2 Make symlinks relative (fixes #100) 2018-03-04 07:35:23 -08:00
Ross Smith II
315ad0873e Fix OS check to match (Cygwin|Msys)* 2018-03-04 06:34:08 -08:00
Ross Smith II
adfedf4b64 Add Mingw/Msys support 2018-03-03 20:02:45 -08:00
Tim Byrne
09a018ea5a
Release 1.12.0
Update version number and update documentation

* Add basic Zsh completion (#71, #79)
* Support directories in `.yadm/encrypt` (#81, #82)
* Support exclusions in `.yadm/encrypt` (#86)
* Improve portability with printf (#87)
* Eliminate usage of `eval` and `ls`
2017-10-24 22:12:23 -05:00
Thomas Luzat
ac2aed9ab4
Indentation: Convert tab to space 2017-10-09 15:21:32 +02:00
Tim Byrne
d411db9f6f
Consolidate cd to YADM_WORK 2017-09-22 12:30:24 -05:00
Tim Byrne
c24906ec10
Handle exclusions in .yadm/encrypt (#86) 2017-09-21 14:21:23 -05:00
Tim Byrne
f23bdb8147
Remove last use of LS_PROGRAM
Globs are not determined by an `eval` of `ls` anymore. The only other
use of `ls` can be replaced with a simple `printf`.
2017-09-16 09:33:12 -05:00
Tim Byrne
b78bb1eef4
Eliminate the use of eval
`eval` has always been used to process the globs in `.yadm/encrypt`.
This is being removed, as there is a risk of executing "dirty" data
found in `.yadm/encrypt`.

Caveats of this change:
  * Brace and tilde expansion will no longer work in `.yadm/encrypt`
  * Paths with spaces must not be quoted anymore
2017-09-16 09:32:38 -05:00
Tim Byrne
57866714c4
Replace echo with printf (#87) 2017-09-15 18:35:41 -05:00
Tim Byrne
abf6cd1c4c
Merge pull request #81 from japm48/patch-1
Add support for directories in .yadm/encrypt
2017-09-04 13:22:21 -05:00
Tim Byrne
5d4f3aac5b
Release 1.11.1
Update version number and update documentation

* Create private dirs prior to merge (#74)
2017-08-23 07:28:35 -05:00
Tim Byrne
ebc90bfc98
Create secured private dirs (#74)
Directories are created prior to merge during clone, and prior to any
Git command run.

This directly addresses CVE-2017-11353.

When cloning a repo which includes data in a .ssh or .gnupg directory,
if those directories do not exist at the time of cloning, yadm will
create the directories with mask 0700 prior to merging the fetched data
into the work-tree.

When running a Git command and .ssh or .gnupg directories do not exist,
create those directories with mask 0700 prior to running the Git
command. However, do not create those directories if
yadm.auto-private-dirs is false.
2017-08-22 21:28:07 -05:00
japm48
8e3a5dbf47 Fix for issue #81
See details in #81
2017-08-20 06:55:59 +02:00
Tim Byrne
4b5b6c44d3
Release 1.11.0
Update version number and update documentation

* Option for Cygwin to copy files instead of symlink (#62)
* Support `YADM_DISTRO` in Jinja templates (#68)
* Support pre/post hooks for every command (#70)
2017-07-09 23:07:50 -05:00
Tim Byrne
0168bcfb5e
Query worktree directly from repo 2017-07-05 16:32:54 -05:00
Tim Byrne
61270c8277
Prevent command from running if "pre" hook fails 2017-07-05 08:12:29 -05:00
Tim Byrne
f73c873681
Expose some internal data to all hooks
* Command run by yadm
* Full commandline arguments
* Repo directory
* Worktree
* Exit status (for post hooks)
2017-07-05 08:12:29 -05:00
Tim Byrne
35743e3711
Tie "post" hooks to yadm exits
There are many cases where yadm may exit early (particularly when
encountering an error).
2017-07-03 16:25:23 -05:00
Tim Byrne
880964e2b2
Some initial tweaks to hooks
* No not require `.sh` extension. Hooks can be written in any language.
* Use `[` for the `-x` test
* Clean up debug message and formatting
2017-07-03 16:25:03 -05:00
Tim Byrne
df21cd2cb8
Merge pull request #70 from cweagans/hooks
Dropping changes to `yadm.md` and `CONTRIBUTORS`. These are built
programmatically during releases.
2017-07-03 16:24:13 -05:00
Tim Byrne
5293db986a
Support YADM_DISTRO in Jinja templates (#68) 2017-07-03 16:21:27 -05:00
Cameron Eagans
41409631a1 Add script hooks 2017-06-22 17:32:16 -06:00
Tim Byrne
7538851fe3
Gracefully handle changes in yadm.cygwin-copy 2017-06-01 17:06:27 -05:00
Tim Byrne
f8e0bd593d
Support yadm.cygwin-copy configuration (#62)
With `yadm.cygwin-copy` set to "true", alternate files will be copies
instead of symlinks, but only when running on Cygwin.
2017-05-31 18:28:54 -05:00
Tim Byrne
68937f3cad
Release 1.10.0
Update version number and update documentation

* Fix `COMP_WORDS bad array subscript` bug (#64)
* Transition to semantic versioning
2017-05-10 17:46:37 -05:00
Tim Byrne
246eab8b52
Release 1.09
Update version number and update documentation

* Add Bash completion script (#60)
* Support WSL detection (#61)
* Add introspect command (used by completion)
2017-05-04 07:22:48 -05:00
Tim Byrne
356c47a19f
Add Bash completion script (#60)
* Add completion script
* Add introspection
2017-04-24 07:49:10 -05:00
Tim Byrne
eabf9091fb
Support WSL detection (#61)
`uname -s` was already being executed every run for *cygwin* detection.
I've consolidated all of the OS detection into a single function. This
also fixed the problem of running `uname -s` twice for the `alt`
command.
2017-04-09 08:47:18 -05:00
Tim Byrne
df4652d6de
Release 1.08
Update version number and update documentation

* Fix bug alternates based on `CLASS` (#51)
* Support globs and paths with space in .yadm/encrypt (#53, #54)
* Add support for alternate files using Jinja templates (#56, #58)
* Add `enter` command, for creating a sub-shell (#57)
* Support local.hostname properly (#59)
2017-04-03 07:09:32 -05:00
Tim Byrne
9824de5410
Change template indicator to ##yadm.j2 2017-03-31 16:42:51 -05:00
Tim Byrne
588bc6eafe
Support local.hostname properly (#59) 2017-03-31 12:43:32 -05:00
Tim Byrne
00133032ef
Add minor improvements to template processing
* Determine envtpl using `command -v` instead of `which` (more portable)
* Anchor the end of template file names in regex
* Quote variables to allow for whitespace in file names
2017-03-30 23:51:23 -05:00
Tim Byrne
aaa4152fac
Remove trailing whitespace 2017-03-30 21:58:26 -05:00
Tim Byrne
fd6fa8c923
Merge pull request #58 from janschulz/jinja_processing
Excluding yadm.md changes (these will happen during a release)
2017-03-30 17:00:27 -05:00
Tim Byrne
4e05be7020
Set prompt for sub-shells 2017-03-30 16:30:22 -05:00