summaryrefslogtreecommitdiff
path: root/doc/todo/avoid_unnecessary_union_merges.mdwn
blob: 5cd4b64373ec9f9b54a4224e6d73cd90df039153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Some commands cause a union merge unnecessarily. For example, `git annex add`
modifies the location log, which first requires reading the current log (if
any), which triggers a merge.

Would be good to avoid these unnecessary union merges. First because it's
faster and second because it avoids a possible delay when a user might
ctrl-c and leave the repo in an inconsistent state. In the case of an add,
the file will be in the annex, but no location log will exist for it (fsck
fixes that).

It may be that all that's needed is to modify Annex.Branch.change
to read the current value, without merging. Then commands like `get`, that
query the branch, will still cause merges, and commands like `add` that
only modify it, will not. Note that for a command like `get`, the merge
occurs before it has done anything, so ctrl-c should not be a problem
there.

This is a delicate change, I need to take care.. --[[Joey]]

> [[done]] (assuming I didn't miss any cases where this is not safe!) --[[Joey]]