From nobody Wed Mar 29 02:53:12 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PmWMJ36nLz41pP5 for ; Wed, 29 Mar 2023 02:53:16 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Received: from wilbur.contactoffice.com (wilbur.contactoffice.com [212.3.242.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PmWMJ1z0nz41Tn for ; Wed, 29 Mar 2023 02:53:16 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Authentication-Results: mx1.freebsd.org; none Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36]) by wilbur.contactoffice.com (Postfix) with ESMTP id 1C3351C24; Wed, 29 Mar 2023 04:53:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1680058395; s=20210208-e7xh; d=mailfence.com; i=sysadmin.lists@mailfence.com; h=Date:From:To:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; l=1949; bh=e8NcQV5005//bLi+f2qYlsYWggKY7tLR7Rq6h1gaUfQ=; b=QG0oXltj4Udt1wzqlV79FuQC9kEthinZBChGEWCUNWoDtIku18WoRJsrKwXhxlp0 6yCP6BC11HrTsWotPtN+iCwlBpO7fcHMfWoaRpO+dPtbc3MY40NDuadP6rn4Y6X20wN duPy16f8Pqwhxd/ovT4cRJuRM8LpVLWRLuNaONOMCEHe+9BaUdfLSfGkP3NVIZPJ80R yf/lv5T5GILNB9yCfamjMo5jDXxwXcxRpaqL67TmyCAFVZoGfu3Zf0SiD673rhAIYpv VruM+hXDzjM7Gzd3yp32n7J+TlYqe9BxwbFwkv8rdb29H7o3Ab0VXzcDQoydJ22OpNb EJU3LQhFMA== Date: Wed, 29 Mar 2023 04:53:12 +0200 (CEST) From: Sysadmin Lists To: freebsd-hackers@freebsd.org Message-ID: <57699630.208778.1680058392828@ichabod.co-bxl> In-Reply-To: References: Subject: Re: what's the Correct git update method keeping local changes List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: void X-Mailer: ContactOffice Mail X-ContactOffice-Account: com:312482426 X-Rspamd-Queue-Id: 4PmWMJ1z0nz41Tn X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:10753, ipnet:212.3.242.64/26, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > ---------------------------------------- > From: void > Date: Mar 27, 2023, 8:19:19 PM > To: > Subject: what's the Correct git update method keeping local changes > > What's the best way? > -- > I use the following interactive script to update and maintain local ports mods. It updates the poudriere jail, switches branches when available, and merges changes to my custom branch. #!/usr/local/bin/bash # update poudriere's ports git repos jail_name="FreeBSD:13:amd64" logfile="/usr/local/etc/poudriere.d/quarterly.log" ports_dir="/usr/local/poudriere/ports/quarterly" ports_list="[list of customized category/portname pairs goes here]" curb=$(git -C $ports_dir branch | sed -n 'x;$p') read -p "==> Update jails? [N|y] " update_jails if [[ $update_jails == "y" ]]; then poudriere jail -uj $jail_name fi # prompt to switch branches if local quarter branch and current quarter differ read month year <<< $(date "+%m %Y") awk 'BEGIN { exit "'${curb: -1}'" == int(('$month' / 3) + .9) }' # (true is 1) if [[ $? == 0 ]]; then read -p "==> Change branch? [n|Y] " change_branch if [[ ! $change_branch == "n" ]]; then set -ve newb=$(git -C $ports_dir branch -rl "*${year}Q*" | sed '$!d') git -C $ports_dir fetch git -C $ports_dir checkout ${newb# origin/} git -C $ports_dir worktree list curb=${newb# origin/} set +ve fi fi read -p "==> Update branches? [n|Y] " update_ports if [[ ! $update_ports == "n" ]]; then set -ve poudriere ports -vup latest git -C $ports_dir checkout $curb poudriere ports -vup quarterly | tee $logfile git -C $ports_dir checkout custombranch git -C $ports_dir rebase $curb for port in $ports_list; do if grep --quiet $port $logfile; then rsync -ax $ports_dir/$port/ \ $ports_dir/${port/*\//custom/}/ fi done set +ve fi exit -- Sent with https://mailfence.com Secure and private email