Re: git and the loss of revision numbers

From: monochrome <monochrome_at_twcny.rr.com>
Date: Tue, 29 Dec 2020 08:28:40 -0500
On 12/29/20 7:15 AM, Kristof Provost wrote:
> On 29 Dec 2020, at 4:33, monochrome wrote:
>> sry forgot details:
>>
>> source tree _at_ ead01bfe8
>>
>> git -C /usr/src checkout gf20c0e331
>> error: pathspec 'gf20c0e331' did not match any file(s) known to git
>>
>> what is the 'g' for?
>>
> That would have been a typo, I think.
> 

the g is also in the uname output:

main-c421-gf20c0e331-dirty

>> git -C /usr/src checkout f20c0e331
>> M       sys/amd64/conf/GENERIC
>> HEAD is now at f20c0e331 caroot: drop $FreeBSD$ expansion from root 
>> bundle
>>
>> yet I don't see any indication that anything changed, and now it wont 
>> update at all:
>>
> If something went wrong there’d be error output.
> Git is *fast*, which can lead you to assume it’s not done anything when 
> it has in fact done exactly what you asked. You should be on that commit 
> now.
> 

that was the full output, and nothing showing that it changed/reverted 
any files, and the contents of /usr/src/.git/refs/heads/main is still 
ead01bfe8618e879b3b23c6cf9f026eadcc7d2b3

is there another place to find the current revision of the source? the 
point here is to revert to a previous known working state of the source 
tree exactly like svnlite update -rXXXXXX /usr/src
used to do, and svn could then update from that point again with the 
same command used to do regular update: svnlite update /usr/src

>> git -C /usr/src pull --ff-only
>> You are not currently on a branch.
>> Please specify which branch you want to merge with.
>> See git-pull(1) for details.
>>
>>     git pull <remote> <branch>
> 
> Yes, you can’t merge to a detached head. Return to your original branch 
> (presumably git checkout main) and then pull.
> 
> Regards,
> Kristof
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"

the point is, there are only 4 commands we need to do this entire thing 
and it should be ironed out:

1. initially download the source tree
2. get the current local source tree revision
3. update the local source tree
4. revert local source tree to previous state

thanks for your input!
Received on Tue Dec 29 2020 - 12:28:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:26 UTC