-
-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ein tool organize
does not recognize and is unable to organize reftable git repositories
#1819
Comments
Thanks a lot for reporting! I took a look and believe it should be possible to teach it to deal with such repositories as it's only using plumbing. gitoxide/gitoxide-core/src/organize.rs Lines 23 to 39 in 6281e1a
It feels like It's an interesting question if it should start to consider it valid while |
Yeah, reftable backend puts More generally, a valid git repository no matter the style may have a non-existent HEAD because "It is legal if the named branch name does not (yet) exist.", such as a empty repository without any commits yet. (which |
I thought I could quickly try it out and make it work, but realized my Git as of version 2.39.5 (from 2024-05-30) doesn't yet support On CI that's probably less of a problem, but for convenience I'd wait until the flag is more mainstream. Meanwhile, here is the patch with a test that I thought would fail (if the fixture can be created). diff --git a/gix-discover/tests/discover/is_git/mod.rs b/gix-discover/tests/discover/is_git/mod.rs
index 09f8576a4..cfa2e95f7 100644
--- a/gix-discover/tests/discover/is_git/mod.rs
+++ b/gix-discover/tests/discover/is_git/mod.rs
@@ -110,6 +110,14 @@ fn missing_configuration_file_is_not_a_dealbreaker_in_nonbare_repo() -> crate::R
Ok(())
}
+#[test]
+fn reftable() -> crate::Result {
+ let repo = repo_path()?.join("reftable-clone");
+ let kind = gix_discover::is_git(&repo)?;
+ assert_eq!(kind, gix_discover::repository::Kind::WorkTree { linked_git_dir: None });
+ Ok(())
+}
+
#[test]
fn split_worktree_using_configuration() -> crate::Result {
for name in [
diff --git a/gix-discover/tests/fixtures/make_basic_repo.sh b/gix-discover/tests/fixtures/make_basic_repo.sh
index 4bc41221a..0e3c35500 100755
--- a/gix-discover/tests/fixtures/make_basic_repo.sh
+++ b/gix-discover/tests/fixtures/make_basic_repo.sh
@@ -103,3 +103,6 @@ mkdir $worktree && touch $worktree/file
git add file
git commit -m "make sure na index exists"
)
+
+git clone --ref-format=reftable . reftable-clone
+ |
Reftable, and the |
That's interesting!
It seems then that either I checked out the wrong tag or the version given here is something different. Or maybe… it's not compiled in?
But it seems that this version doesn't come with reftable by default, or it's not yet available as argument.
|
Well, git 2.39, even with some slightly newer support patches, is not git 2.45, so? I applied the patch adding the reftable test but I cannot figure out how to run it. |
I found the date confusing, it said:
|
That worked, and the reftable test indeed fails, with on the surface level this seems odd to me, I would think that an empty repository without any commits also has a missing head, since in that scenario HEAD is |
A |
Which generated tar file should I be looking for? I don't see any that seem relevant / contain a A PR with the patch you posted applied, with the tar file? |
note: I applied the patch on top of tag edit: applying on top of |
Sorry for the confusion - I missed that So let's hold off until that changes. One day the test-suite might need to be upgraded to be able to control the Git version it's using, both on CI and locally. |
Well, I really need I can manually make a tar archive of I'm not familiar with the MacOS landscape, but both homebrew and macports have at least git |
Actually there is a way. The script the test was in originally is not producing a tar file, but any other file will. Hence, the test could move into The test needs to execute once and reference that new shell-script for the tar file to be created automatically. |
Done and PR made at #1825 |
Current behavior 😯
I have a directory of git repositories cloned with
git clone --mirror
and rely onein tool organize
to organize them. Recently I have started usinggit clone --ref-format=reftable
, and unexpectedly foundein tool organize
to no recognize them, reporting no errors or warnings.ein 0.41.0
git version 2.48.1
Expected behavior 🤔
ein tool organize
should recognize these as git repositories, and move their entire contents regardless of ref-format or whatever else they are under the--destination-directory
, organized by their URL, as is done normally.Based on the requirements git lays out, for this specific case I believe
ein tool organize
should safely be able to declare all current extensions as recognized and proceed normally, without needing to handle them specially, as none of them affect determining the clone URL or moving all repository contents, whatever they may be, to the destination.Git behavior
I have not specifically tried
git remote -v
with an older version of git, however I have tried that command on the current version with a repository with a config modified to have afakeabc = true
extension, andgit
does fail due to the unknown extension in this case.Steps to reproduce 🕹
cd $(mktemp -d)
git clone --ref-format=reftable --mirror https://github.com/GitoxideLabs/gitoxide.git
ein tool organize -t $(mktemp -d) -f $(realpath .)
reports nothingThe text was updated successfully, but these errors were encountered: