From def7e732db230b99264550d44e6f22ccafe0ea2e Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Fri, 10 Feb 2017 14:32:07 -0800 Subject: [PATCH] Release 1.07 Update version number and update documentation * Add `CLASS` to supported alt-link patterns (#21) * Add bootstrap command (#42) * Support wildcards for alt-links (#43) * Stash conflicting data during clone (#44) * Offer bootstrap after successful clone (#45) * Display supported configs for `yadm config` (#46) * Add "curl-pipe" program to clone without installation (#48) * Fix bug in alt-link regular expressions (#49) --- CHANGES | 10 ++++++ LICENSE | 2 +- yadm | 4 +-- yadm.1 | 2 +- yadm.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++--------- yadm.spec | 5 ++- 6 files changed, 101 insertions(+), 20 deletions(-) diff --git a/CHANGES b/CHANGES index af5fe6d..633a40d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,13 @@ +1.07 + * Add `CLASS` to supported alt-link patterns (#21) + * Add bootstrap command (#42) + * Support wildcards for alt-links (#43) + * Stash conflicting data during clone (#44) + * Offer bootstrap after successful clone (#45) + * Display supported configs for `yadm config` (#46) + * Add "curl-pipe" program to clone without installation (#48) + * Fix bug in alt-link regular expressions (#49) + 1.06 * Improve portability of `hostname` (#23) * Fix incompatibilities between Cygwin and Git for Windows (#26) diff --git a/LICENSE b/LICENSE index c7efe34..a491495 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ yadm - Yet Another Dotfiles Manager -Copyright (C) 2015 Tim Byrne +Copyright (C) 2015-2017 Tim Byrne This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/yadm b/yadm index c8b287b..f238575 100755 --- a/yadm +++ b/yadm @@ -1,6 +1,6 @@ #!/bin/sh # yadm - Yet Another Dotfiles Manager -# Copyright (C) 2015 Tim Byrne +# Copyright (C) 2015-2017 Tim Byrne # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ if [ -z "$BASH_VERSION" ]; then [ "$YADM_TEST" != 1 ] && exec bash "$0" "$@" fi -VERSION=1.06 +VERSION=1.07 YADM_WORK="$HOME" YADM_DIR="$HOME/.yadm" diff --git a/yadm.1 b/yadm.1 index 6226fbe..c0e8db7 100644 --- a/yadm.1 +++ b/yadm.1 @@ -1,5 +1,5 @@ ." vim: set spell so=8: -.TH yadm 1 "13 January 2017" "1.06" +.TH yadm 1 "10 February 2017" "1.07" .SH NAME yadm \- Yet Another Dotfiles Manager .SH SYNOPSIS diff --git a/yadm.md b/yadm.md index 719c949..8e0d767 100644 --- a/yadm.md +++ b/yadm.md @@ -11,7 +11,7 @@ yadm init [-f] [-w directory] - yadm clone url [-f] [-w directory] + yadm clone url [-f] [-w directory] [--bootstrap] [--no-bootstrap] yadm config name [value] @@ -19,6 +19,8 @@ yadm list [-a] + yadm bootstrap + yadm encrypt yadm decrypt [-l] @@ -54,22 +56,36 @@ alternates by default. This automatic behavior can be disabled by setting the configuration yadm.auto-alt to "false". + bootstrap + Execute $HOME/.yadm/bootstrap if it exists. + clone url Clone a remote repository for tracking dotfiles. After the con- tents of the remote repository have been fetched, a "merge" of origin/master is attempted. If there are conflicting files already present in the work-tree, this merge will fail and - instead a "reset" of origin/master will be done. It is up to - the user to resolve these conflicts, but if the desired action - is to have the contents in the repository overwrite the existing - files, then a "hard reset" should accomplish that: + instead a "reset" of origin/master will be done, followed by a + "stash". This "stash" operation will preserve the original data. + + You can review the stashed conflicts by running the command - yadm reset --hard origin/master + yadm stash show -p + + from within your $HOME directory. If you want to restore the + stashed data, you can run + + yadm stash apply + or + yadm stash pop The repository is stored in $HOME/.yadm/repo.git. By default, $HOME will be used as the work-tree, but this can be overridden with the -w option. yadm can be forced to overwrite an existing - repository by providing the -f option. + repository by providing the -f option. By default yadm will ask + the user if the bootstrap program should be run (if it exists). + The options --bootstrap or --no-bootstrap will either force the + bootstrap to be run, or prevent it from being run, without + prompting the user. config This command manages configurations for yadm. This command works exactly they way git-config(1) does. See the CONFIGURA- @@ -149,6 +165,9 @@ --yadm-archive Override the location of the yadm encrypted files archive. + --yadm-bootstrap + Override the location of the yadm bootstrap program. + ## CONFIGURATION yadm uses a configuration file named $HOME/.yadm/config. This file uses the same format as git-config(1). Also, you can control the con- @@ -196,15 +215,40 @@ Specify an alternate program to use instead of "git". By default, the first "git" found in $PATH is used. + These last four "local" configurations are not stored in the + $HOME/.yadm/config, they are stored in the local repository. + + + local.class + Specify a CLASS for the purpose of symlinking alternate files. + By default, no CLASS will be matched. + + local.os + Override the OS for the purpose of symlinking alternate files. + + local.hostname + Override the HOSTNAME for the purpose of symlinking alternate + files. + + local.user + Override the USER for the purpose of symlinking alternate files. + ## ALTERNATES When managing a set of files across different systems, it can be useful to have an automated way of choosing an alternate version of a file for a different operating system, host, or user. yadm implements a feature which will automatically create a symbolic link to the appropriate ver- sion of a file, as long as you follow a specific naming convention. - yadm can detect files with names ending in: + yadm can detect files with names ending in any of the following: - ## or ##OS or ##OS.HOSTNAME or ##OS.HOSTNAME.USER + ## + ##CLASS + ##CLASS.OS + ##CLASS.OS.HOSTNAME + ##CLASS.OS.HOSTNAME.USER + ##OS + ##OS.HOSTNAME + ##OS.HOSTNAME.USER If there are any files managed by yadm's repository, or listed in $HOME/.yadm/encrypt, which match this naming convention, symbolic links @@ -213,6 +257,7 @@ yadm's repository: - $HOME/path/example.txt## + - $HOME/path/example.txt##Work - $HOME/path/example.txt##Darwin - $HOME/path/example.txt##Darwin.host1 - $HOME/path/example.txt##Darwin.host2 @@ -241,17 +286,40 @@ $HOME/path/example.txt -> $HOME/path/example.txt## - If no "##" version exists and no files match the current OS/HOST- + If running on a system, with CLASS set to "Work", the link will be: + + $HOME/path/example.txt -> $HOME/path/example.txt##WORK + + If no "##" version exists and no files match the current CLASS/OS/HOST- NAME/USER, then no link will be created. Links are also created for directories named this way, as long as they have at least one yadm managed file within them. - OS is determined by running uname -s, HOSTNAME by running hostname -s, - and USER by running id -u -n. yadm will automatically create these - links by default. This can be disabled using the yadm.auto-alt configu- - ration. Even if disabled, links can be manually created by running - yadm alt. + CLASS must be manually set using yadm config local.class . OS + is determined by running uname -s, HOSTNAME by running hostname, and + USER by running id -u -n. yadm will automatically create these links + by default. This can be disabled using the yadm.auto-alt configuration. + Even if disabled, links can be manually created by running yadm alt. + + It is possible to use "%" as a "wildcard" in place of CLASS, OS, HOST- + NAME, or USER. For example, The following file could be linked for any + host when the user is "harvey". + + $HOME/path/example.txt##%.%.harvey + + CLASS is a special value which is stored locally on each host (inside + the local repository). To use alternate symlinks using CLASS, you must + set the value of class using the configuration local.class. This is + set like any other yadm configuration with the yadm config command. The + following sets the CLASS to be "Work". + + yadm config local.class Work + + Similarly, the values of OS, HOSTNAME, and USER can be manually over- + ridden using the configuration options local.os, local.hostname, and + local.user. + ## ENCRYPTION It can be useful to manage confidential files, like SSH or GPG keys, diff --git a/yadm.spec b/yadm.spec index a0ea4db..efe0c38 100644 --- a/yadm.spec +++ b/yadm.spec @@ -1,6 +1,6 @@ Summary: Yet Another Dotfiles Manager Name: yadm -Version: 1.06 +Version: 1.07 Release: 1%{?dist} URL: https://github.com/TheLocehiliosan/yadm License: GPLv3 @@ -37,6 +37,9 @@ install -m 644 yadm.1 ${RPM_BUILD_ROOT}%{_mandir}/man1 %doc CHANGES CONTRIBUTORS README.md %changelog +* Fri Feb 10 2017 Tim Byrne - 1.07-1 +- Bump version to 1.07 + * Fri Jan 13 2017 Tim Byrne - 1.06-1 - Bump version to 1.06