From 90ec3f22388ad31e7c3a2ae92bcccbf6c8347b9c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 4 Jan 2021 17:01:51 -0400 Subject: [PATCH] promote forum post to bug report --- ...ranchrefresh_ignored_by_git_annex_add.mdwn | 52 +++++++++++++++++++ ..._2688af420095e2e9aebf6caeb904ba48._comment | 14 +++++ ..._999bd4a511c7fa39f5455df895c435f3._comment | 8 +++ 3 files changed, 74 insertions(+) create mode 100644 doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add.mdwn create mode 100644 doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add/comment_1_2688af420095e2e9aebf6caeb904ba48._comment create mode 100644 doc/forum/adjustedbranchrefresh_ignored__63__/comment_1_999bd4a511c7fa39f5455df895c435f3._comment diff --git a/doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add.mdwn b/doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add.mdwn new file mode 100644 index 0000000000..025cf887b6 --- /dev/null +++ b/doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add.mdwn @@ -0,0 +1,52 @@ +In some occasions `annex.adjustedbranchrefresh` is ignored when `git annex sync` is run in a branch created with `adjust --unlock-present`. + +If `annex.adjustedbranchrefresh` is set to 1, one would expect git-annex to automatically adjust the branch once a file has been `git annex add`-ed or the repository is `git annex sync`-ed. However this does not happen and a manual `git annex adjust --unlock-present` is required. + +Is this a bug or am I misunderstanding how `annex.adjustedbranchrefresh` is supposed to work? + +> It is a bug --[[Joey]] + +The following script reproduces this bug. + +``` +#!/bin/bash + +set -eux + +rm -Rvf /tmp/an-repo.git && mkdir /tmp/an-repo.git && cd /tmp/an-repo.git +git init --bare +n=$(date +%s) ; mkdir /tmp/ga-$n && cd /tmp/ga-$n +git clone --no-local --no-hardlinks /tmp/an-repo.git +cd an-repo/ + +git config user.email "email@example.com" ; git config user.name "Name Name" +git config annex.thin true +git config annex.adjustedbranchrefresh 1 +git config remote.origin.annex-ignore true + +# 8.20201117 is the version in the standalone tarball of 8.20201127 +~/Applications/git-annex/8.20201117-ga314537cd/runshell bash -c ' +git annex init foobar + +echo "aaaa" > a && echo "bbbb" > b +git annex add a b +git annex sync + +git annex adjust --unlock-present +git annex sync + +echo "cccc" > c && echo "dddd" > d +git annex add c d + +echo "## before sync" +stat -c "%n: %F" a b c d + +git annex sync +echo "## after sync" +stat -c "%n: %F" a b c d # should show four regular files, but shows two files and two symlinks + +git annex sync --content; +echo "## after sync --content" +stat -c "%n: %F" a b c d # ibid +' +``` diff --git a/doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add/comment_1_2688af420095e2e9aebf6caeb904ba48._comment b/doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add/comment_1_2688af420095e2e9aebf6caeb904ba48._comment new file mode 100644 index 0000000000..343305da0c --- /dev/null +++ b/doc/bugs/adjustedbranchrefresh_ignored_by_git_annex_add/comment_1_2688af420095e2e9aebf6caeb904ba48._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2021-01-04T20:57:22Z" + content=""" +So I think the whole problem is that, git-annex add (and import, addurl, +etc) should add the files unlocked when in an unlockpresent branch. + +I don't think git-annex sync needs to deal with this, problably. + +Don't think this really has anything to do with adjustedbranchrefresh. +That's about updates after getting/dropping files, and that's not been done +in this case. +"""]] diff --git a/doc/forum/adjustedbranchrefresh_ignored__63__/comment_1_999bd4a511c7fa39f5455df895c435f3._comment b/doc/forum/adjustedbranchrefresh_ignored__63__/comment_1_999bd4a511c7fa39f5455df895c435f3._comment new file mode 100644 index 0000000000..7e5bc31366 --- /dev/null +++ b/doc/forum/adjustedbranchrefresh_ignored__63__/comment_1_999bd4a511c7fa39f5455df895c435f3._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2021-01-04T20:49:40Z" + content=""" +I agree, this is a bug. Copied to +[[bugs/adjustedbranchrefresh_ignored_by_git_annex_add]]. +"""]]