projects/repronim/bugs-done/annex init no longer generates default descriptionkylehttp://git-annex.branchable.com/projects/repronim/bugs-done/annex_init_no_longer_generates_default_description/git-annexikiwiki2023-01-05T17:30:31Zuuid.log is also not createdhttp://git-annex.branchable.com/projects/repronim/bugs-done/annex_init_no_longer_generates_default_description/comment_1_eb415152db43c02e4d474dade4a1faca/kyle2023-01-05T17:30:31Z2019-06-05T15:18:30Z
<p>As of that same commit (a14f6ce75), running <code>git annex init</code> in a fresh repository no longer creates uuid.log:</p>
<pre><code>% cd $(mktemp -dt gx-XXXXXXX)
% git init
Initialized empty Git repository in /tmp/gx-kpnGSjg/.git/
% git annex init
init ok
% git ls-tree -r git-annex ;# no output
</code></pre>
Issue with description cache?http://git-annex.branchable.com/projects/repronim/bugs-done/annex_init_no_longer_generates_default_description/comment_2_c51d386f294529d6ebe7058438577ffe/kyle2023-01-05T17:30:31Z2019-06-17T21:11:14Z
<p>I took another look at this thinking that maybe I could spot something obvious in the condition added in a14f6ce75</p>
<pre><code> {- Avoid overwriting existing description with a default
- description. -}
whenM (pure (isJust mdescription) <||> not . M.member u <$> uuidDescMap) $
describeUUID u =<< genDescription mdescription
</code></pre>
<p>but that looks fine. Grepping around for uuidDescMap, I spotted a couple of places where the cache needed to be invalidated. Blindly applying that same approach I did</p>
<pre><code>diff --git a/Annex/Init.hs b/Annex/Init.hs
index cb7f8905e..6303103df 100644
--- a/Annex/Init.hs
+++ b/Annex/Init.hs
@@ -76,6 +76,7 @@ genDescription Nothing = do
initialize :: Maybe String -> Maybe RepoVersion -> Annex ()
initialize mdescription mversion = checkCanInitialize $ do
+ uuidDescMapLoad
{- Has to come before any commits are made as the shared
- clone heuristic expects no local objects. -}
sharedclone <- checkSharedClone
</code></pre>
<p>That fixes the problem on my end (i.e., <code>git annex init</code> sets the description to the default user@host:dir description) while still addressing the original issue fixed by a14f6ce75.</p>
<p>So it seems like it has something to do with the uuidDescMap cache, but I haven't been able to figure out what in particular.</p>
comment 3http://git-annex.branchable.com/projects/repronim/bugs-done/annex_init_no_longer_generates_default_description/comment_3_6edae77c6ee7e4c4f94f9c0daff375ad/joey2023-01-05T17:30:31Z2019-06-21T00:12:51Z
<p>Thanks Kyle, that does point at the problem. In uuidDescMapLoad
it implicitly adds the UUID of the current repo, with an empty
description if none is set. So, the added check of uuidDescMap
always finds the UUID in it already. Your uuidDescMapLoad hack
avoids this by loading the map before the current repo has a UUID.</p>
<p>Fixed more cleanly..</p>
thankshttp://git-annex.branchable.com/projects/repronim/bugs-done/annex_init_no_longer_generates_default_description/comment_4_d92a7f2bc72b27c74cd86811c9bbf098/kyle2023-01-05T17:30:31Z2019-06-21T02:05:24Z
Thank you for the explanation and fix!
bug fix releasehttp://git-annex.branchable.com/projects/repronim/bugs-done/annex_init_no_longer_generates_default_description/comment_5_0dd1d4e6cd16da2865c3153b61b9e282/Ilya_Shlyakhter2023-01-05T17:30:31Z2019-06-22T16:14:58Z
@joeyh Thanks for fixing this. Would it be possible to make a new release on Hackage? I'd like to make a new <a href="http://git-annex.branchable.com/install/conda/">conda</a> release that incorporates the improvements in version <code>7.20190615</code>, but don't want to make a release that fails DataLad tests the default one. Thanks!
comment 6http://git-annex.branchable.com/projects/repronim/bugs-done/annex_init_no_longer_generates_default_description/comment_6_539039e237d9b0db0c97f64d877de7f7/joey2023-01-05T17:30:31Z2019-06-25T17:14:03Z
Release soon.