1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2025-06-04 08:33:57 +00:00

Update CHANGES and prepare for 3.4.0

This commit is contained in:
Erik Flodin 2025-02-09 22:03:16 +01:00
parent 7e19d21f09
commit c90aa86051
No known key found for this signature in database
GPG Key ID: 420A7C865EE3F85F
7 changed files with 127 additions and 79 deletions

15
CHANGES
View File

@ -1,3 +1,18 @@
3.4.0
* Improve and harden alt file regeneration (#466)
* Fix "yadm config" in fish completion (#491)
* Fix "yadm clone" when not run in "$YADM_WORK" (#513)
* Output the actual paths in help message (#376)
* Verify all alt conditions for templates (#478)
* Ignore case in alt and default template conditions (#455, #456)
* Fall back to ID for distro family if ID_LIKE is not available (#494)
* Support overriding distro and distro family (#430)
* Improve support for Bash 3 (the default version on macOS)
* Make "yadm clone --recursive" work as expected (#517)
* Don't include files multiple times in archive (#125)
* Document YADM_HOOK_DATA and YADM_HOOK_DIR env variables (#343)
* Support alt dirs with deeply nested tracked files (#495)
3.3.0 3.3.0
* Support nested ifs in default template (#436) * Support nested ifs in default template (#436)
* Support include and ifs in default template includes (#406) * Support include and ifs in default template includes (#406)

View File

@ -3,8 +3,8 @@ CONTRIBUTORS
Tim Byrne Tim Byrne
Erik Flodin Erik Flodin
Martin Zuther Martin Zuther
Jan Schulz
Ross Smith II Ross Smith II
Jan Schulz
Jonathan Daigle Jonathan Daigle
Luis López Luis López
Tin Lai Tin Lai
@ -15,11 +15,13 @@ James Clark
Glenn Waters Glenn Waters
Nicolas signed-log FORMICHELLA Nicolas signed-log FORMICHELLA
Tomas Cernaj Tomas Cernaj
AVM.Martin
Joshua Cold Joshua Cold
jonasc jonasc
Nicolas stig124 FORMICHELLA Nicolas stig124 FORMICHELLA
Chad Wade Day, Jr Chad Wade Day, Jr
Sébastien Gross Sébastien Gross
Christof Warlich
David Mandelberg David Mandelberg
Paulo Köch Paulo Köch
Oren Zipori Oren Zipori
@ -47,6 +49,7 @@ Tim Condit
Thomas Luzat Thomas Luzat
Russ Allbery Russ Allbery
Patrick Roddy Patrick Roddy
heddxh
dessert1 dessert1
Brayden Banks Brayden Banks
Alexandre GV Alexandre GV

View File

@ -72,8 +72,8 @@ The star count helps others discover yadm.
[master-badge]: https://img.shields.io/github/actions/workflow/status/yadm-dev/yadm/test.yml?branch=master [master-badge]: https://img.shields.io/github/actions/workflow/status/yadm-dev/yadm/test.yml?branch=master
[master-commits]: https://github.com/yadm-dev/yadm/commits/master [master-commits]: https://github.com/yadm-dev/yadm/commits/master
[master-date]: https://img.shields.io/github/last-commit/yadm-dev/yadm/master.svg?label=master [master-date]: https://img.shields.io/github/last-commit/yadm-dev/yadm/master.svg?label=master
[obs-badge]: https://img.shields.io/badge/OBS-v3.3.0-blue [obs-badge]: https://img.shields.io/badge/OBS-v3.4.0-blue
[obs-link]: https://software.opensuse.org//download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm [obs-link]: https://software.opensuse.org/download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
[releases-badge]: https://img.shields.io/github/tag/yadm-dev/yadm.svg?label=latest+release [releases-badge]: https://img.shields.io/github/tag/yadm-dev/yadm.svg?label=latest+release
[releases-link]: https://github.com/yadm-dev/yadm/releases [releases-link]: https://github.com/yadm-dev/yadm/releases
[transcrypt]: https://github.com/elasticdog/transcrypt [transcrypt]: https://github.com/elasticdog/transcrypt

3
yadm
View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
# yadm - Yet Another Dotfiles Manager # yadm - Yet Another Dotfiles Manager
# Copyright (C) 2015-2024 Tim Byrne # Copyright (C) 2015-2024 Tim Byrne
# Copyright (C) 2025 Erik Flodin
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -21,7 +22,7 @@ if [ -z "$BASH_VERSION" ]; then
[ "$YADM_TEST" != 1 ] && exec bash "$0" "$@" [ "$YADM_TEST" != 1 ] && exec bash "$0" "$@"
fi fi
VERSION=3.3.0 VERSION=3.4.0
YADM_WORK="$HOME" YADM_WORK="$HOME"
YADM_DIR= YADM_DIR=

6
yadm.1
View File

@ -1,5 +1,5 @@
.\" vim: set spell so=8: .\" vim: set spell so=8:
.TH YADM 1 "November 8, 2024" "3.3.0" .TH YADM 1 "February 9, 2025" "3.4.0"
.SH NAME .SH NAME
@ -1012,10 +1012,12 @@ Report issues or create pull requests at GitHub:
https://github.com/yadm-dev/yadm/issues https://github.com/yadm-dev/yadm/issues
.SH AUTHOR .SH AUTHORS
Tim Byrne <sultan@locehilios.com> Tim Byrne <sultan@locehilios.com>
Erik Flodin <erik@flodin.me>
.SH SEE ALSO .SH SEE ALSO
.BR git (1), .BR git (1),

171
yadm.md
View File

@ -28,11 +28,11 @@
yadm perms yadm perms
yadm enter [ command ] yadm enter [command]
yadm git-crypt [ options ] yadm git-crypt [options]
yadm transcrypt [ options ] yadm transcrypt [options]
yadm upgrade [-f] yadm upgrade [-f]
@ -95,26 +95,26 @@
decrypt decrypt
Decrypt all files stored in $HOME/.local/share/yadm/archive. Decrypt all files stored in $HOME/.local/share/yadm/archive.
Files decrypted will be relative to the configured work-tree Files decrypted will be relative to the configured work-
(usually $HOME). Using the -l option will list the files stored tree (usually $HOME). Using the -l option will list the files
without extracting them. stored without extracting them.
encrypt encrypt
Encrypt all files matching the patterns found in $HOME/.con Encrypt all files matching the patterns found in $HOME/.con
fig/yadm/encrypt. See the ENCRYPTION section for more details. fig/yadm/encrypt. See the ENCRYPTION section for more details.
enter Run a sub-shell with all Git variables set. Exit the sub-shell enter Run a sub-shell with all Git variables set. Exit the sub-shell
the same way you leave your normal shell (usually with the the same way you leave your normal shell (usually with the
"exit" command). This sub-shell can be used to easily interact "exit" command). This sub-shell can be used to easily interact
with your yadm repository using "git" commands. This could be with your yadm repository using "git" commands. This could be
useful if you are using a tool which uses Git directly, such as useful if you are using a tool which uses Git directly, such as
tig, vim-fugitive, git-cola, etc. tig, vim-fugitive, git-cola, etc.
Optionally, you can provide a command after "enter", and instead Optionally, you can provide a command after "enter", and instead
of invoking your shell, that command will be run with all of the of invoking your shell, that command will be run with all of the
Git variables exposed to the command's environment. Git variables exposed to the command's environment.
Emacs Tramp and Magit can manage files by using this configura Emacs Tramp and Magit can manage files by using this configura
tion: tion:
(add-to-list 'tramp-methods (add-to-list 'tramp-methods
@ -128,58 +128,58 @@
With this config, use (magit-status "/yadm::"). With this config, use (magit-status "/yadm::").
git-crypt options git-crypt options
If git-crypt is installed, this command allows you to pass op If git-crypt is installed, this command allows you to pass op
tions directly to git-crypt, with the environment configured to tions directly to git-crypt, with the environment configured to
use the yadm repository. use the yadm repository.
git-crypt enables transparent encryption and decryption of files git-crypt enables transparent encryption and decryption of files
in a git repository. You can read https://github.com/AGWA/git- in a git repository. You can read https://github.com/AGWA/git-
crypt for details. crypt for details.
gitconfig gitconfig
Pass options to the git config command. Since yadm already uses Pass options to the git config command. Since yadm already uses
the config command to manage its own configurations, this com the config command to manage its own configurations, this com
mand is provided as a way to change configurations of the repos mand is provided as a way to change configurations of the repos
itory managed by yadm. One useful case might be to configure itory managed by yadm. One useful case might be to configure
the repository so untracked files are shown in status commands. the repository so untracked files are shown in status commands.
yadm initially configures its repository so that untracked files yadm initially configures its repository so that untracked files
are not shown. If you wish use the default Git behavior (to are not shown. If you wish use the default Git behavior (to
show untracked files and directories), you can remove this con show untracked files and directories), you can remove this con
figuration. figuration.
yadm gitconfig --unset status.showUntrackedFiles yadm gitconfig --unset status.showUntrackedFiles
help Print a summary of yadm commands. help Print a summary of yadm commands.
init Initialize a new, empty repository for tracking dotfiles. The init Initialize a new, empty repository for tracking dotfiles. The
repository is stored in $HOME/.local/share/yadm/repo.git. By repository is stored in $HOME/.local/share/yadm/repo.git. By
default, $HOME will be used as the work-tree, but this can be default, $HOME will be used as the work-tree, but this can be
overridden with the -w option. yadm can be forced to overwrite overridden with the -w option. yadm can be forced to overwrite
an existing repository by providing the -f option. an existing repository by providing the -f option.
list Print a list of files managed by yadm. The -a option will cause list Print a list of files managed by yadm. The -a option will cause
all managed files to be listed. Otherwise, the list will only all managed files to be listed. Otherwise, the list will only
include files from the current directory or below. include files from the current directory or below.
introspect category introspect category
Report internal yadm data. Supported categories are commands, Report internal yadm data. Supported categories are commands,
configs, repo, and switches. The purpose of introspection is to configs, repo, and switches. The purpose of introspection is to
support command line completion. support command line completion.
perms Update permissions as described in the PERMISSIONS section. It perms Update permissions as described in the PERMISSIONS section. It
is usually unnecessary to run this command, as yadm automati is usually unnecessary to run this command, as yadm automati
cally processes permissions by default. This automatic behavior cally processes permissions by default. This automatic behavior
can be disabled by setting the configuration yadm.auto-perms to can be disabled by setting the configuration yadm.auto-perms to
"false". "false".
transcrypt options transcrypt options
If transcrypt is installed, this command allows you to pass op If transcrypt is installed, this command allows you to pass op
tions directly to transcrypt, with the environment configured to tions directly to transcrypt, with the environment configured to
use the yadm repository. use the yadm repository.
transcrypt enables transparent encryption and decryption of transcrypt enables transparent encryption and decryption of
files in a git repository. You can read files in a git repository. You can read https://github.com/elas
https://github.com/elasticdog/transcrypt for details. ticdog/transcrypt for details.
upgrade upgrade
Version 3 of yadm uses a different directory for storing data. Version 3 of yadm uses a different directory for storing data.
@ -223,7 +223,7 @@
The following is the full list of universal options. Each option The following is the full list of universal options. Each option
should be followed by a path. should be followed by a path.
-Y,--yadm-dir -Y, --yadm-dir
Override the yadm directory. yadm stores its configurations Override the yadm directory. yadm stores its configurations
relative to this directory. relative to this directory.
@ -329,8 +329,9 @@
Disable the permission changes to $HOME/.ssh/*. This feature is Disable the permission changes to $HOME/.ssh/*. This feature is
enabled by default. enabled by default.
The following five "local" configurations are not stored in the
$HOME/.config/yadm/config, they are stored in the local repository. The following "local" configurations are not stored in the $HOME/.con
fig/yadm/config, they are stored in the local repository.
local.class local.class
@ -354,6 +355,14 @@
local.user local.user
Override the user for the purpose of symlinking alternate files. Override the user for the purpose of symlinking alternate files.
local.distro
Override the distro for the purpose of symlinking alternate
files.
local.distro-family
Override the distro family for the purpose of symlinking alter
nate files.
## ALTERNATES ## ALTERNATES
When managing a set of files across different systems, it can be useful When managing a set of files across different systems, it can be useful
@ -377,6 +386,8 @@
<attribute>[.<value>] <attribute>[.<value>]
NOTE: Value is compared case-insensitive.
These are the supported attributes, in the order of the weighted prece These are the supported attributes, in the order of the weighted prece
dence: dence:
@ -406,13 +417,14 @@
distro_family, f distro_family, f
Valid if the value matches the distro family. Distro family is Valid if the value matches the distro family. Distro family is
calculated by inspecting the ID_LIKE line from /etc/os-release. calculated by inspecting the ID_LIKE line from /etc/os-release
(or ID if no ID_LIKE line is found).
os, o Valid if the value matches the OS. OS is calculated by running os, o Valid if the value matches the OS. OS is calculated by running
uname -s. uname -s.
arch, a arch, a
Valid if the value matches the architecture. Architecture is Valid if the value matches the architecture. Architecture is
calculated by running uname -m. calculated by running uname -m.
default default
@ -421,30 +433,31 @@
extension, e extension, e
A special "condition" that doesn't affect the selection process. A special "condition" that doesn't affect the selection process.
Its purpose is instead to allow the alternate file to end with a Its purpose is instead to allow the alternate file to end with a
certain extension to e.g. make editors highlight the content certain extension to e.g. make editors highlight the content
properly. properly.
NOTE: The OS for "Windows Subsystem for Linux" is reported as "WSL",
NOTE: The OS for "Windows Subsystem for Linux" is reported as "WSL",
even though uname identifies as "Linux". even though uname identifies as "Linux".
You may use any number of conditions, in any order. An alternate will You may use any number of conditions, in any order. An alternate will
only be used if ALL conditions are valid. For all files managed by only be used if ALL conditions are valid. For all files managed by
yadm's repository or listed in $HOME/.config/yadm/encrypt, if they yadm's repository or listed in $HOME/.config/yadm/encrypt, if they
match this naming convention, symbolic links will be created for the match this naming convention, symbolic links will be created for the
most appropriate version. most appropriate version.
The "most appropriate" version is determined by calculating a score for The "most appropriate" version is determined by calculating a score for
each version of a file. A template is always scored higher than any each version of a file. A template is always scored higher than any
symlink condition. The number of conditions is the next largest factor symlink condition. The number of conditions is the next largest factor
in scoring. Files with more conditions will always be favored. Any in in scoring. Files with more conditions will always be favored. Any in
valid condition will disqualify that file completely. valid condition will disqualify that file completely.
If you don't care to have all versions of alternates stored in the same If you don't care to have all versions of alternates stored in the same
directory as the generated symlink, you can place them in the directory as the generated symlink, you can place them in the
$HOME/.config/yadm/alt directory. The generated symlink or processed $HOME/.config/yadm/alt directory. The generated symlink or processed
template will be created using the same relative path. template will be created using the same relative path.
Alternate linking may best be demonstrated by example. Assume the fol Alternate linking may best be demonstrated by example. Assume the fol
lowing files are managed by yadm's repository: lowing files are managed by yadm's repository:
- $HOME/path/example.txt##default - $HOME/path/example.txt##default
@ -467,7 +480,7 @@
$HOME/path/example.txt -> $HOME/path/example.txt##os.Darwin $HOME/path/example.txt -> $HOME/path/example.txt##os.Darwin
Since the hostname doesn't match any of the managed files, the more Since the hostname doesn't match any of the managed files, the more
generic version is chosen. generic version is chosen.
If running on a Linux server named "host4", the link will be: If running on a Linux server named "host4", the link will be:
@ -482,27 +495,28 @@
$HOME/path/example.txt -> $HOME/path/example.txt##class.Work $HOME/path/example.txt -> $HOME/path/example.txt##class.Work
If no "##default" version exists and no files have valid conditions, If no "##default" version exists and no files have valid conditions,
then no link will be created. then no link will be created.
Links are also created for directories named this way, as long as they Links are also created for directories named this way, as long as they
have at least one yadm managed file within them (at the top level). have at least one yadm managed file within them.
yadm will automatically create these links by default. This can be dis yadm will automatically create these links by default. This can be dis
abled using the yadm.auto-alt configuration. Even if disabled, links abled using the yadm.auto-alt configuration. Even if disabled, links
can be manually created by running yadm alt. can be manually created by running yadm alt.
Class is a special value which is stored locally on each host (inside Class is a special value which is stored locally on each host (inside
the local repository). To use alternate symlinks using class, you must the local repository). To use alternate symlinks using class, you must
set the value of class using the configuration local.class. This is set the value of class using the configuration local.class. This is
set like any other yadm configuration with the yadm config command. The set like any other yadm configuration with the yadm config command. The
following sets the class to be "Work". following sets the class to be "Work".
yadm config local.class Work yadm config local.class Work
Similarly, the values of architecture, os, hostname, and user can be Similarly, the values of architecture, os, hostname, user, distro, and
manually overridden using the configuration options local.arch, lo distro_family can be manually overridden using the configuration op
cal.os, local.hostname, and local.user. tions local.arch, local.os, local.hostname, local.user, local.distro,
and local.distro-family.
## TEMPLATES ## TEMPLATES
@ -519,6 +533,9 @@
on most *nix systems. To use this processor, specify the value on most *nix systems. To use this processor, specify the value
of "default" or just leave the value off (e.g. "##template"). of "default" or just leave the value off (e.g. "##template").
NOTE: This template processor performs case-insensitive compari
sions in if statements.
ESH ESH is a template processor written in POSIX compliant shell. It ESH ESH is a template processor written in POSIX compliant shell. It
allows executing shell commands within templates. This can be allows executing shell commands within templates. This can be
used to reference your own configurations within templates, for used to reference your own configurations within templates, for
@ -534,6 +551,7 @@
envtpl To use the envtpl Jinja template processor, specify the value of envtpl To use the envtpl Jinja template processor, specify the value of
"j2" or "envtpl". "j2" or "envtpl".
NOTE: Specifying "j2" as the processor will attempt to use j2cli or en NOTE: Specifying "j2" as the processor will attempt to use j2cli or en
vtpl, whichever is available. vtpl, whichever is available.
@ -614,19 +632,19 @@
are supported. gpg is used by default, but openssl can be configured are supported. gpg is used by default, but openssl can be configured
with the yadm.cipher configuration. with the yadm.cipher configuration.
To use this feature, a list of patterns must be created and saved as To use this feature, a list of patterns (one per line) must be created
$HOME/.config/yadm/encrypt. This list of patterns should be relative and saved as $HOME/.config/yadm/encrypt. This list of patterns should
to the configured work-tree (usually $HOME). For example: be relative to the configured work-tree (usually $HOME). For example:
.ssh/*.key .ssh/*.key
.gnupg/*.gpg .gnupg/*.gpg
Standard filename expansions (*, ?, [) are supported. If you have Bash Standard filename expansions (*, ?, [) are supported. Two consecutive
version 4, you may use "**" to match all subdirectories. Other shell asterisks "**" can be used to match all subdirectories. Other shell
expansions like brace and tilde are not supported. Spaces in paths are expansions like brace and tilde are not supported. Spaces in paths are
supported, and should not be quoted. If a directory is specified, its supported, and should not be quoted. If a directory is specified, its
contents will be included, but not recursively. Paths beginning with a contents will be included. Paths beginning with a "!" will be ex
"!" will be excluded. cluded.
The yadm encrypt command will find all files matching the patterns, and The yadm encrypt command will find all files matching the patterns, and
prompt for a password. Once a password has confirmed, the matching prompt for a password. Once a password has confirmed, the matching
@ -661,6 +679,7 @@
- https://github.com/AGWA/git-crypt - https://github.com/AGWA/git-crypt
## PERMISSIONS ## PERMISSIONS
When files are checked out of a Git repository, their initial permis When files are checked out of a Git repository, their initial permis
sions are dependent upon the user's umask. Because of this, yadm will sions are dependent upon the user's umask. Because of this, yadm will
@ -714,6 +733,12 @@
YADM_HOOK_COMMAND YADM_HOOK_COMMAND
The command which triggered the hook The command which triggered the hook
YADM_HOOK_DATA
The path to the yadm data directory
YADM_HOOK_DIR
The path to the yadm directory
YADM_HOOK_EXIT YADM_HOOK_EXIT
The exit status of the yadm command The exit status of the yadm command
@ -799,9 +824,11 @@
https://github.com/yadm-dev/yadm/issues https://github.com/yadm-dev/yadm/issues
## AUTHOR ## AUTHORS
Tim Byrne <sultan@locehilios.com> Tim Byrne <sultan@locehilios.com>
Erik Flodin <erik@flodin.me>
## SEE ALSO ## SEE ALSO
git(1), gpg(1) openssl(1) transcrypt(1) git-crypt(1) git(1), gpg(1) openssl(1) transcrypt(1) git-crypt(1)

View File

@ -1,7 +1,7 @@
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
Name: yadm Name: yadm
Summary: Yet Another Dotfiles Manager Summary: Yet Another Dotfiles Manager
Version: 3.3.0 Version: 3.4.0
Group: Development/Tools Group: Development/Tools
Release: 1%{?dist} Release: 1%{?dist}
URL: https://yadm.io URL: https://yadm.io