Greg Troxel <
g...@lexort.com> writes:
> I guess I should have said more coherently: if we mean, as I think we
> do, that it is safe and reasonable to call bup init on an already
> initialized repository, then it would be good to simply say that. I
> would expect many readers to think it scary to call init on a place with
> existing data.
I understood, and I just meant that until this recent work, I hadn't
worked more carefully with init, and didn't know what we had intended,
or was feasible. I know git itself handles reinitialization, but wasn't
completely familiar with the promises there either. And with -r and
~/.bup we have additional existing complexity/behavior to consider.
So I've been conservative about making commitments. And while I think it
should be safe to reinitialize, we've recently done related work there,
and I think we probably will formalize that, I wasn't ready to promise
it yet.
It's also the case that part of what we would/will be promising is
"whatever git-init does".
> It is not fair, but I was seeing this as a bit of a regression, because
> I'm moving from hand-patched to 16 to trying to use the new mechanism.
Ahh, right. Suppose for now you might want a bup init wrapper or
similar.
> Now, I'm not finding the bup-config xref.
>
> Perhaps add
>
> See bup-config(5) for a description of configuration variables that may
> be set on a repo. Typically, it is best practice to set them at
> repo init time.
Agreed, I'd started adding something like that, but not the note about
setting them during initialization. Good idea, and I'll probably
augment it a bit further.
> I was reading the pending docs and not the release notes. I had
> multiple problems: 1) not knowing bup config syntax for multilevel
> variables (my error) and 2) being unclear that that "16" was not
> acceptable.
I think I'll contemplate adding an example or two somewhere.
> if that's what it is. "skips a bit" is too hard to understand.
I think that legacy:16 still works with 16 bits, it just ignores a bit
in the broader computation. This is mentioned in DESIGN (thanks to
Johannes):
What we do instead is we extend the hashsplit algorithm a little
further using what we call "fanout." Instead of checking just the last
13 bits of the checksum, we use additional checksum bits to produce
additional splits. Note that (most likely due to an implementation
bug), the next higher bit after the 13 bits (marked 'x'):
...... '..x1'1111'1111'1111
is actually ignored (so the fanout starts just to the left of the
x). Now, let's say we use a 4-bit fanout. That means we'll break a
series of chunks into its own tree object whenever the next 4 bits of
the rolling checksum are 1, in addition to the 13 lowest ones. Since
the 13 lowest bits already have to be 1, the boundary of a group of
chunks is necessarily also always the boundary of a particular chunk.
> I suspect almost zero are relying on implicit init in scripts, and those
> could adjust easily. I realize it's a tough call; I generally lean to
> clean up semantics if the total pain imposed (amount * people) is
> smaller than the cognitive load on everyone else.
>
> Are you really saying that you can do
>
> bup save -r host:
>
> when there is no ~/.bup in host, and it will do an initialization first?
I'm not positive, but yes, I think so, and likely in any number of other
cases. I believe we used to implicitly try to create ~/.bup in one of
the main lower-level "find the repo" functions.
But I hesitate(d) because we've also "dialed down" the ~/.bup automagic
in some places, so I was wondering if that might have invalidated the
bup-init(1) claim, and sure enough (0.33.7):
$ ls -l ~/.bup
ls: cannot access '/home/rlb/.bup': No such file or directory
$ bup -d ~/tmp/bup-test-repo save -r localhost: -n lib lib
error: repository b'/home/rlb/.bup/' does not exist (see "bup help init")
error: server tunnel returned exit code 15
I was also able to provoke one of the errors you saw when I had the
remote bup set to main in the PATH:
$ bup -d ~/tmp/test-repo save -r localhost: -n lib lib
error: /home/rlb/.bup/ is missing (see "bup help init")
Exception ignored in: <function LocalRepo.__del__ at 0x7f3eb7a89da0>
Traceback (most recent call last):
File "/home/rlb/src/bup/main/lib/bup/repo/local.py", line 67, in __del__
def __del__(self): assert self.closed
AttributeError: 'ServerRepo' object has no attribute 'closed'
If that's repeatable, I can investigate, but it might be "expected"
right now cross-version. As mentioned, it should be harmless, if
confusing, and I'll have to think about what we want to do. Those
errors are intended to help make sure we always explicitly manage
relevant resources, and have helped notably improve that in main.
> I meant to suggest:
>
> Delete "By default the connection to the remote server is made with
> SSH." so that one leaves the description to bup(1).
>
> because -r is more complicated, and ssh is so normal that not-ssh is
> odd.
Ahh, OK.