yadm-dev / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
5.15k stars 177 forks source link

yadm list [-a]: extra option for absolute paths #392

Closed ferdinandyb closed 2 years ago

ferdinandyb commented 2 years ago

Is your feature request related to a problem? Please describe.

When doing yadm list -a files paths are given relative to the work tree (?, my knowledge of git is limited so I'm not sure that is the write word), i.e $HOME in the default case. If you want to use this to pass files to other programs and you are NOT in $HOME, you somehow have to prepend $HOME to the listed paths, otherwise they point to non-existing files. A specific use-case: I have a shortcut in vim, that uses fzf to choose from and open one of my dotfiles, so I currently need to wrap the yadm list -a command:

#!/bin/bash

function _yadm_list_all(){
  yadm list -a | while read -r  line; do
    echo $HOME/$line
  done
}

_yadm_list_all

I guess if $HOME is not the base, than you'd somehow have to get that from git.

Describe the solution you'd like

An extra flag to yadm list (maybe f?), so that yadm list -af lists the files with their absolute path. And for symmetry, yadm list -f would list absolute paths for the files tracked below the current directory.

Describe alternatives you've considered

It's not hard to write your own wrapper :)

github-actions[bot] commented 2 years ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been labeled as stale for 7 days with no activity.

jeffwindsor commented 1 year ago

This would be very helpful for supplying lists to fuzzy finders, esp nvim telescope. If it is acceptable to re-open I will submit a pull request for this change

ferdinandyb commented 1 year ago

This would be very helpful for supplying lists to fuzzy finders, esp nvim telescope. If it is acceptable to re-open I will submit a pull request for this change

Since this was closed due to inactivity, I doubt a PR would be a problem.