From e0022e6505437a4ed70498e83d85c3795950bb62 Mon Sep 17 00:00:00 2001 From: CandyAngel Date: Mon, 7 Oct 2019 08:30:53 +0000 Subject: [PATCH] Added a comment --- ..._3ff54cd13085a9fc2d8f9953691da8d2._comment | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 doc/forum/lets_discuss_git_add_behavior/comment_6_3ff54cd13085a9fc2d8f9953691da8d2._comment diff --git a/doc/forum/lets_discuss_git_add_behavior/comment_6_3ff54cd13085a9fc2d8f9953691da8d2._comment b/doc/forum/lets_discuss_git_add_behavior/comment_6_3ff54cd13085a9fc2d8f9953691da8d2._comment new file mode 100644 index 0000000000..9f23dbdf88 --- /dev/null +++ b/doc/forum/lets_discuss_git_add_behavior/comment_6_3ff54cd13085a9fc2d8f9953691da8d2._comment @@ -0,0 +1,36 @@ +[[!comment format=mdwn + username="CandyAngel" + avatar="http://cdn.libravatar.org/avatar/15c0aade8bec5bf004f939dd73cf9ed8" + subject="comment 6" + date="2019-10-07T08:30:52Z" + content=""" +If you want to add the file to git, use `git add`. +If you want to add the file to git-annex, use `git annex add`. +Simples! + +There isn't any other behaviour which is a more obvious default. + +> Suppose you have an unlocked file in your repo, and you rename it (not using git move), and then git add it. Oops, now you've added to git a large file that you wanted to be annexed + +If you wanted it to be annexed, you should have `git annex add`'d it! git-annex doesn't (and can't) know that the user wanted something different from the totally valid command they issued. + +> you would surely hope that the annexed ones stay annexed and don't get committed directly to git + +If the modified file changes its match state from largefiles (e.g. crossing a filesize threshold), it would still change state between annexed/non-annexed, wouldn't it? + +> keeping track of which files are supposed to be in the annex and which in git is very failure prone +> And it needs to default to adding files to the annex, otherwise the above two cases can cause problems. + +Not only is it failure prone, the only thing that knows which is wanted is.. the user. The decision to usurp git and the user creates the first 2 problem cases. If you go with the expectation that the user will issue the correct commands for what they want to happen (fair, considering only the user knows), the first two cases are obviously not problems. + +> If git add does something the user doesn't want + +Why would it? It just adds files to git, right? + +> Recovery [..] from [adding file to git] can be arbitrarily compilicated, including needing to fix problems in clones on other people's computers. + +And this can still totally happen if largefiles is not set correctly for what the user wants. + + +Sure, you can set up git-annex to do magic to make your workflow easier or more seamless. Key words there being \"*set up*\". It shouldn't be doing such magic by default. +"""]]