Download raw body.
Got is unhappy with the FreeBSD repository
On Sun, Feb 26, 2023 at 04:37:00PM +0100, Christian Weisgerber wrote: > Stefan Sperling: > > > Thanks. Please commit it with my OK. I will eventually get around to > > making this behave in a better way. I suppose at the very least > > got update should report an obstructed file rather than erroring out. > > It's not just a theoretical concern. It means that in a worktree > any "got update", including "got update -b <branch>", is blocked > across a file<->directory change. What I can do for now is make sure that an obstruction is signalled. Going beyond that is probably far from trivial, unfortunately. I know this can be really annoying to deal with, but from experience I also know that this is part of a huge problem space that needs quite a bit of careful effort to be solved properly. There is still design work to be done, and then implementation work. I have spent years solving such issues in SVN, starting in the SVN 1.6 release cycle up to and including SVN 1.14. Even SVN is not yet at the point where cases of files clashing with directories can be resolved with automated assistance. For now, users should think of Got as being no more capable than CVS in dealing with structural changes. This should suffice for OpenBSD at least, provided once OpenBSD devs starte using Got (or Git) they would not also start doing reckless things outside the scope of their current usage of CVS. Ideally, Got would handle such conflicts systematically and offer options for resolution. This is something I want to work on eventually, probably once gotd and sha256 support are "done". I don't have enough spare time to work on two large problem spaces in parallel. I would of course be happy to help with advice if someone wants to start work on this sooner. > For instance, I now have a FreeBSD repository where I cannot perform > "got up -b origin/main && got rb main". > (Yes, yes, I could extract myself from this by throwing the worktree > away and using "git" or "got ref" to move "main". That's not the > point.) You can be as creative as you want, and if it means that a work tree has to be thrown away and started over, that is acceptable to me, at least for now. In several cases Got flags obstructions already, and on purpose there is not yet even documentation which covers how to get out of such situations. This is an obvious gap in both documentation and functionality that needs to be filled and I don't want to paper over it or hide it. What the manual page currently says is this, which is intended to cover cases such as the one you ran into: CAVEATS In situations where files or directories were moved around got will not automatically merge changes to new locations and git(1) will usually produce better results. > Every time I play around with this, I run into new forms of breakage: Please put any such cases you find interesting into xfail test cases. They will be needed eventually. > $ echo gamma >gamma > $ got add gamma > A gamma > $ got ci -m 'another new file' > A gamma > Created commit 9a3d262133b87f62ad3b9917b869fc7e5dafdd18 > $ got rm gamma > D gamma > $ mkdir gamma > $ echo delta >gamma/delta > $ got add gamma/delta > A gamma/delta > $ got st # oh, oh > ~ gamma > A gamma/delta > $ got ci > got-read-tree: bad object data > got: bad object data > $ got rv -R . > got-read-tree: bad object data > got: unexpected end of file > > Here's another one, where I removed a file "alpha" and then created > "alpha/beta" in its place: > > $ got log -sr dummy.git > 2023-02-26 main another new file > 2023-02-26 ba3899c create directory in place of old file > 2023-02-26 315b701 remove file > 2023-02-26 405b133 initial import > $ got co -c 405b133 dummy.git > A /home/naddy/tmp/dummy/alpha > Checked out refs/heads/main: 405b133a1e204c4f166f69e074fd69b94acdb18f > Now shut up and hack > $ cd dummy > $ cat alpha > alpha > $ got up > U alpha > got: stat: /home/naddy/tmp/dummy/alpha/beta: Not a directory > $ cat -v alpha > 100644 beta^@eM-2M-_M-^GM-wM-_:M-nM-^M-pKM-ig^CM-eZM-AM-^\,M-{ > > -- > Christian "naddy" Weisgerber naddy@mips.inka.de > >
Got is unhappy with the FreeBSD repository