Added a comment

This commit is contained in:
CandyAngel 2019-10-07 08:30:53 +00:00 committed by admin
parent 586278cfa8
commit e0022e6505

View file

@ -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.
"""]]