TheLocehiliosan / yadm

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

Older yadm repo incompatible with newest version of yadm? #348

Closed rseward closed 2 years ago

rseward commented 3 years ago

Describe the bug

I have a yadm dotfile repo created in a older version of yadm.

yadm --version
git version 2.25.1

The repo works great with this older version of yadm. However when I try to clone this repo with the newest version of yadm (yadm-3.1.0-70.1), yadm failes to clone the dotfiles.

My clone command fails with output as follows:

yadm clone -f git@bitbucket.org:mybitbucketaccount/my-dotfiles.git
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.10529.21311/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.10529.21311/': No such file or directory
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
Cloning into 'repo.git'...
Receiving objects: 100% (65/65), 9.00 KiB | 0 bytes/s, done.
Resolving deltas: 100% (31/31), done.
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory
fatal: Could not switch to '/home/myuser/.local/share/yadm/tmp.20701.32188/': No such file or directory

To reproduce

  1. I believe the bug can be created by creating a git repo using the yadm 2.25 version
  2. Attempt to clone the git dotfile repo using yadm 3.1.0

Can this be reproduced with the yadm/testbed docker image: [Not Sure]

Steps to reproduce the behavior:

  1. Run command '....'
  2. Run command '....'
  3. Run command '....'
  4. See error

Expected behavior

I would expect dotfiles from a previous version of yadm should be clone-able by the latest version.

I might be asking for advice on how to resolve the errors using yadm 3.1 to check out my existing repo. I am open to the idea of creating a new repo with yadm 3.1 and checking a set of dotfiles into that version.

Environment

Additional context

None

pescobar commented 3 years ago

I am experiencing the same problem on a centos7 machine. I have downloaded yadm version 2.5.0 to workaround it.

rseward commented 2 years ago

I am experiencing the same problem on a centos7 machine. I have downloaded yadm version 2.5.0 to workaround it.

@pescobar Where do you find the 2.5.0 yadm RPM?

pescobar commented 2 years ago

I didn't use an RPM. I downloaded latest 2.x from GitHub releases page to /usr/local/bin

TheLocehiliosan commented 2 years ago

I've been able to recreate this. I was a bit surprised by this report as I regularly use many CentOS 7 hosts. However, it seems the incompatibility is from the older version of Git available in the CentOS 7 repos (I typically have a more modern version of Git installed).

The cloning technique has changed in more recent versions of yadm. I still have to get to the bottom of incompatibility, but once I do, I'll see if there is a good way to support Git 1.8.3.1.

I have confirmed if you install a newer version of Git, the clone operation works just fine.

TheLocehiliosan commented 2 years ago

@rseward / @pescobar - Can you test with this branch, "Fix-CentOS7-348"?

https://github.com/TheLocehiliosan/yadm/tree/Fix-CentOS7-348

https://github.com/TheLocehiliosan/yadm/commit/939aa4714f270946fabba99cd7e0c5f01d261e22

I think this small change will probably fix the clone issue on older versions of Git.

pescobar commented 2 years ago

@TheLocehiliosan thanks for the fix!

I have tested it in a centos7.8 machine with git 1.8.3.1 and yadm clone is working fine for me

TheLocehiliosan commented 2 years ago

This fix will be part of the new version released today.