tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc and git



On Fri, 18 Jul 2025 at 15:02, John Klos <john%klos.com@localhost> wrote:
>
> > My first guess is that there was some corruption in your checkout.
>
> There shouldn't be. This system has had no panics or other unexpected
> restarts, and I just updated it a month ago.
>
> > The error message is clear: it says that 0ad-data/COMMIT_MSG in your
> > version of the repository is untracked (i.e. not part of the git
> > repository, a new file), but that the changes you pulled from the
> > server include a file at that location, and that the new file would
> > overwrite your unknown one.
> >
> > In case you were really adding this locally while it was added
> > upstream, you'd need to either move it aside, or commit it locally and
> > merge the changes from upstream with yours.
>
> I haven't added any files, or changed, or moved. I'm interested in what
> the underlying problem is because if things like this happen to a
> completely untouched wip, it could happen to pkgsrc when pkgsrc is in git,
> and it'd be good to know what the error means and what people should do
> about it.

Is there anything strange in `git reflog` which will tell all (but in
a way where nothing makes sense).

My off hand guess is that HEAD was somehow reset vis:

thomasina$ git reset --hard b35ecb196e881bf1ced33730681807f131989594
Updating files: 100% (7344/7344), done.
HEAD is now at b35ecb196e 0ad-data: Update to 0.27.0

thomasina$ git reset HEAD^
hint: It took 9.31 seconds to refresh the index after reset.  You can use
hint: '--no-refresh' to avoid this.

thomasina$ git status
On branch master
Your branch is behind 'origin/master' by 338 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    0ad-data/
nothing added to commit but untracked files present (use "git add" to track)

thomasina$ git fetch
thomasina$ git rebase # Listen, don't mention git pull! I mentioned it
once, but I think I got away with it alright.
error: The following untracked working tree files would be overwritten
by checkout:
    0ad-data/COMMIT_MSG
    0ad-data/DESCR
    0ad-data/Makefile
    0ad-data/PLIST
    0ad-data/distinfo
Please move or remove them before you switch branches.
Aborting
error: could not detach HEAD

which reflog shows as:

917c02303d (HEAD -> master) HEAD@{0}: reset: moving to HEAD^
b35ecb196e HEAD@{1}: reset: moving to b35ecb196e881bf1ced33730681807f131989594

But you mentioned the repo was clean.  I guess that leaves us with a
rebase barfing leaving an equivalent mess.

PS: `git clean -df ; git rebase` dug me out of the above hole

> >> At some point a good CVS -> git cheat sheet would be good, including
> >> covering problems and errors.
> >
> > cjep started a document for after the conversion:
> >
> > https://wiki.netbsd.org/users/cjep/git4pkgsrc/
> >
> > but the server details are of course not filled in yet, since we
> > haven't switched.
>
> This is a good start (but obviously for different reasons than the issue
> above).
>
> Thanks!
> John


Home | Main Index | Thread Index | Old Index