Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jun 2022 14:02:38 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Andy Farkas <andyf@andyit.com.au>
Cc:        freebsd-ports@freebsd.org, grembo@freebsd.org
Subject:   Re: git pull not replicating?
Message-ID:  <D52E77A9-923F-46C8-B8A2-FD72F8B6919D@yahoo.com>
In-Reply-To: <f6147fb6-a3db-3058-f374-4f7260ee9481@andyit.com.au>
References:  <9038328B-04B5-47BB-9526-4CB8B94B9C53.ref@yahoo.com> <9038328B-04B5-47BB-9526-4CB8B94B9C53@yahoo.com> <f6147fb6-a3db-3058-f374-4f7260ee9481@andyit.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2022-Jun-18, at 13:24, Andy Farkas <andyf@andyit.com.au> wrote:


> Thank you Michael and Mark, you have increased my understanding of git
> such that it now makes a bit more sense of what is going on. The many
> many git manpages I find hard to comprehend. (what does <tree-ish>
> supposed to mean?)
> 
> On 19/06/2022 3:13 am, Mark Millard wrote:
> 
>> (Deleting/moving directory
>> trees from the likes of inside /usr/ports is a
>> valid type of development operation.
> 
> I see. That makes sense.
> 
>> "git -C /usr/ports pull" is basically a sequence
>> ( I made the command explicit about /usr/ports ):
>> 
>> # git -C /usr/ports fetch
>> # git -C /usr/ports merge
> 
> The manpage mentions this.
> 
>> The git fetch means that you have a full copy available
>> locally...
> 
> ... of the .git tree...

The .git repository and its representation is distinct
from your local directory tree that you normally use.
The repository has history and such not visible in
the local directory tree that you normally use.

>>  that you could check out into a directory tree...
> 
> ... via 'git merge':

checkout and merge are different operations.

checkout is more of a replacement. (But clean -fd can
also be relevant, depending on intent.)

merge is for combining two variations into one. You had
created a context with two variations, one in your local
directory tree and one in what you had fetched.

"git -C /usr/ports pull" does not do a checkout as
its 2nd step. It does merge.

Do not take anything I wrote as any objection to the
use of other possible sequences that involve checkout.

>> The git merge has to do with updating the local
>> directory tree to deal with both already-changed
>> local content and the fetched material.
> 
> Seems I had a misunderstanding of 'merge' and 'checkout'.
> 
>> It is not the goal of this to do the likes of a
>> "git -C /usr/ports reset --hard HEAD".

Nor is the goal to do the likes of a checkout.

> Ah-ha!
> 
>> A question here is if you maintain any deliberate
>> changes of your own in your tree. (Are you acting
>> like a developer at all?)
> 
> I'm a mere mortal user... although I was once listed in the now
> non-existent FreeBSD 'Contributors' web page...

https://docs.freebsd.org/en/articles/contributors/ ?
It lists: "Andy Farkas andyf@speednet.com.au" under
"8. Additional FreeBSD Contributors". (You might want
the speednet.com.au replaced?)

I've never been listed as a contributor but I do have
a few local changes (both system and ports).

You might want to fetch without merge (no pull) and
do the checkout or "reset --hard HEAD" sort of
activity separately. It does not sound like you
expect to ever want an actual merge.

(It is possible to reach back before HEAD instead if
something recent needs to be avoided.)

>> # git -C /usr/ports reset --hard HEAD
>> 
>> would destroy any deliberate changes to things
>> in your /usr/ports tree.
> 
> Bingo!  This is what I'm after.

FYI: Do not take it as the only way.

>> git is biased to on-going development and so expects
>> to deal with differences being involved in the local
>> directory tree. It is extra work to be sure no
>> differences occur or to remove the differences when
>> unintended ones show up. It is not automatic.
> 
> There ya go..



===
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D52E77A9-923F-46C8-B8A2-FD72F8B6919D>