From eb8e0594bbe8ffe3ca1040db029728084f86270b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Dec 2022 16:02:42 -0400 Subject: [PATCH] use status --ignore-submodules in configureSmudgeFilter Speed up git-annex upgrade (from v5) and init in a repository that has submodules. Setting the config does not affect the submodules, so avoid the work of getting status in them, which may involve using the smudge filter etc. Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project --- CHANGELOG | 2 ++ Config/Smudge.hs | 6 +++++- ...grade_to_not_care_about_submod_status__63__.mdwn | 1 + ...ment_1_607ec43498187636312693932f66cc6d._comment | 13 +++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__/comment_1_607ec43498187636312693932f66cc6d._comment diff --git a/CHANGELOG b/CHANGELOG index 7a423117d9..2cf7b63c02 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,8 @@ git-annex (10.20221213) UNRELEASED; urgency=medium * Added --anything (and --nothing). Eg, git-annex find --anything will list all annexed files whether or not the content is present. This is slightly faster and clearer than --include=* or --exclude=* + * Speed up git-annex upgrade (from v5) and init in a repository that has + submodules. -- Joey Hess Mon, 12 Dec 2022 13:04:54 -0400 diff --git a/Config/Smudge.hs b/Config/Smudge.hs index 2b3303307f..da198096fe 100644 --- a/Config/Smudge.hs +++ b/Config/Smudge.hs @@ -29,7 +29,11 @@ configureSmudgeFilter = unlessM (fromRepo Git.repoIsLocalBare) $ do -- unexpected changes when the file is checked into git or annex -- counter to the annex.largefiles configuration. -- Avoid that problem by running git status now. - inRepo $ Git.Command.runQuiet [Param "status", Param "--porcelain"] + inRepo $ Git.Command.runQuiet + [ Param "status" + , Param "--porcelain" + , Param "--ignore-submodules" + ] setConfig (ConfigKey "filter.annex.smudge") "git-annex smudge -- %f" setConfig (ConfigKey "filter.annex.clean") "git-annex smudge --clean -- %f" diff --git a/doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__.mdwn b/doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__.mdwn index 5f5a655a2b..cc419a8ab5 100644 --- a/doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__.mdwn +++ b/doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__.mdwn @@ -18,3 +18,4 @@ I guess it could have used some flavor of `--ignore-submodules` with its invocat [[!meta author=yoh]] [[!tag projects/repronim]] +> [[fixed|done]] --[[Joey]] diff --git a/doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__/comment_1_607ec43498187636312693932f66cc6d._comment b/doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__/comment_1_607ec43498187636312693932f66cc6d._comment new file mode 100644 index 0000000000..b7c1ba8400 --- /dev/null +++ b/doc/todo/git_annex_upgrade_to_not_care_about_submod_status__63__/comment_1_607ec43498187636312693932f66cc6d._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2022-12-20T19:48:52Z" + content=""" +This happens on upgrade from a v5 repository, which calls +configureSmudgeFilter. [[!commit 401a79675ba2f125545ec9ec77376cb4b965fa4a]] +explains why it needs to run status there. + +So, it will indeed be ok to pass --ignore-submodules, since each submodule +that is a git-annex repository will get upgraded in its own time, +and will run configureSmudgeFilter then. +"""]] -- 2.30.2