Date: Wed, 3 Mar 2021 16:10:15 +0100 From: Michael Grimm <trashcan@ellael.org> To: freebsd-git@freebsd.org, freebsd-questions@freebsd.org Subject: Re: ports and git, first steps Message-ID: <B98FC9B8-216F-48CF-9FCC-18E780E13CDE@ellael.org> In-Reply-To: <YD6XP9uqNwa9L5y%2B@acme.spoerlein.net> References: <6996AB6C-B178-48C2-94D4-1F7D62E59998@ellael.org> <YD6XP9uqNwa9L5y%2B@acme.spoerlein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[CC'd to freebsd-questions] Ulrich Sp=C3=B6rlein <uqs@FreeBSD.org> wrote: > On Tue, 2021-03-02 at 13:23:56 +0100, Michael Grimm wrote: >> I am running STABLE-13 and use poudriere (svn+https) to compile my = ports of interest. >>=20 >> Disclaimer: I do consider myself a newbie with regard to git. >>=20 >> After my migration from svn to git regarding sources, I recently = installed a git repository for ports sources. It is working as expected, = good. >>=20 >> But then I added some local ports to the ports directory, which I = added to .git/info/exclude. Ok, that worked out. >>=20 >> Now I had had to modify the Makefile of www/wordpress like I did = before in the svn ports tree. Now git complained: >>=20 >> mwn> git status >> On branch master >> Your branch is up to date with 'origin/master'. >>=20 >> Changes not staged for commit: >> (use "git add <file>..." to update what will be committed) >> (use "git restore <file>..." to discard changes in working = directory) >> modified: www/wordpress/Makefile >>=20 >> It took 3.44 seconds to enumerate untracked files. 'status -uno' >> may speed it up, but you have to be careful not to forget to add >> new files yourself (see 'git help status'). >> no changes added to commit (use "git add" and/or "git commit = -a") >>=20 >> Thus I applied 'git commit': >>=20 >> mwn> git commit -a -m "modified to compile wordpress without = llvm" >> [master 39b5d0652] modified to compile wordpress without llvm >> Committer: admin mer-waases.net <root@mer-waases.net> >> Your name and email address were configured automatically based >> on your username and hostname. Please check that they are = accurate. >> You can suppress this message by setting them explicitly. Run = the >> following command and follow the instructions in your editor to = edit >> your configuration file: >>=20 >> git config --global =E2=80=94edit >>=20 >> After doing this, you may fix the identity used for this commit = with: >>=20 >> git commit --amend --reset-author >> =09 >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> Now, 'git status' shows: >>=20 >> mwn> git status >> On branch master >> Your branch is ahead of 'origin/master' by 1 commit. >> (use "git push" to publish your local commits) >>=20 >>=20 >> It took 3.17 seconds to enumerate untracked files. 'status -uno' >> may speed it up, but you have to be careful not to forget to add >> new files yourself (see 'git help status'). >> nothing to commit, working tree clean >>=20 >> Well, that looks fine for a git newbie, But there are some questions = left for me: >>=20 >> 1) Will my commited Makefile become overwritten if the master = Makefile becomes modified in the future? (I hope so) >=20 > No, due to how I think (!) poudriere works, your change should remain. >=20 >> 2) Will all upcoming modifications in = 'remote.origin.url=3Dgit://github.com/freebsd/freebsd-ports.git' be = pulled, >> although 'Your branch is ahead of 'origin/master' by 1 commit.'? >=20 > I think poudriere does a `git pull --rebase` always, which fetches = upstream and then rebases your changes on top. So your local changes = will always be there, but they can of course come into conflict with = upstream changes at which point you'll need to resolve those conflicts. Does anyone know if poudriere is using 'git pull =E2=80=94rebase' as = default? >> 3) Is there a better, more suited way to deal with local = modifications? >=20 > I'm not sure. For SVN I used to have a separate myports ports = collection with the uncommitted changes and I haven't switch to git = ports yet. But I would just have my local diffs "on top" of upstream. Ok, I did create a local port instead, and modified the Makefile there. = Now my modification is no longer leading to the 'issue' mentionend = above. >> 4) In analogy to the recommendations for src and git, I did run 'git = config pull.ff only'. >> Is that wrong when it comes to ports (I do not understand what that = means, yet) >=20 > That might actually be in conflict with the git pull --rebase that = poudriere does. I assume though that the argv addition will overwrite = your config setting. But in any case, for a tree with local changes on = top, ff-only is the wrong choice. Either always git pull --rebase or = maybe you can make rebase the default via that config (instead of -ff). I did remove this setting from .git/config. Now poudriere is the only = process dealing with pulls. > hth Yes, very much appreciated. Thanks and regards, Michael
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B98FC9B8-216F-48CF-9FCC-18E780E13CDE>