From patchwork Tue Oct 8 19:06:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13826874 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7851F21500E for ; Tue, 8 Oct 2024 19:07:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728414422; cv=none; b=j8mqVwBKW/rUZ1Eo3eIq9OrFsWSgQjOd25hQ1ML2xlPxLnLKJx/D2HbSRnaKejud0MR/W/640uuMQIWVWWAgy818oeI8Xc31nKWOlQS7ZVJjoNlU9w8B9LFqMQh6I1Nsa6HqGdtSsAfWdvPCuywb06imk1VR9XbDfqUFZcf5edE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728414422; c=relaxed/simple; bh=zCFdnW6t0qWGA9ZwS/ShqNE56OfMyY1C17q4RftwYp4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=flQID3gtGGp1w94N9I5D403gjN+N6pC9HnDzsNI2AWm+qvBLdTV8CYT/IUSr/+HA4vmSA/Y6gH5/a0T9soNo/wpoRkkmpMEXO+bQ+PxE33mcBwlsSC39EoRu+CCxu9A3ym34G+mrmNumcScPfVaBAHJqI6c093shefwKcN0w2/U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=khaugsbakk.name; spf=pass smtp.mailfrom=khaugsbakk.name; dkim=pass (2048-bit key) header.d=khaugsbakk.name header.i=@khaugsbakk.name header.b=JhlM9Os0; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ODAk9be6; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=khaugsbakk.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=khaugsbakk.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=khaugsbakk.name header.i=@khaugsbakk.name header.b="JhlM9Os0"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ODAk9be6" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id A6E5B11401B9; Tue, 8 Oct 2024 15:06:59 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Tue, 08 Oct 2024 15:06:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=khaugsbakk.name; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1728414419; x=1728500819; bh=ohG/QKOTA26PKP/Z3/iftCrehFXGPh1x LP9rYbZQcpk=; b=JhlM9Os0GxtcFNLmimU/JApzNP6qPkGEIhTN7THa31Bkq6+G 6QfXckMYjXXBLk1D9iv5aFCZiXbW5ihbQqH0VpLlxkfqJ7N0juU9Qz19SxmWNkqx RNjZ45oBIj5dng0aoi9GJMg864poHs1g3KQ14a0Yi9Lq3FoQbcu4tEzWe24aZHc3 SmneOE9WhL7Qlbto3VjqkDlzFEVLd3UrmsWijlD/rlk9/KYqfWbO5nB9RN00O0Z+ MbNEP9DX302UfYZMyWtUJvLdyJBNg5IQBQYVGgZuiuVIHqo+3lhhiDHsVdq4JWwB cV6FutbFV7BMzCqIAt8McLtKLNQjSfuWpXg+PA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728414419; x= 1728500819; bh=ohG/QKOTA26PKP/Z3/iftCrehFXGPh1xLP9rYbZQcpk=; b=O DAk9be6wNAiOUwrnqy5peiQbAIebWsgNugsbSbFsaGdgHDkdMFq3K+BOnBV+Fhi9 IFrBu97KkTMZbXEvHzmfr3thNkzRGxjR9ItXO+IUnA8HjsvvcMK82y9Gwq604Ua6 P27Aeukzc2LKGv/WTkrooE6jkVRj8RwXg5pEQC60fQ1sWEQzj2wFy9I+GqUG9o/H 2N2NaEL+ng+BTNtLmYZmmjM9Vj9Al1buq6DIFv6CHjWNm8/0+17L3Y7tEo1XfAyh r7yAj/v8ORQmTo37fLlhIOkDxmbHCJhL9+CJzcqYPzG0ZebR6POrPregmwYdcV/A NSS1IbxwbWf3OVKWJ0QjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdefuddgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredt jeenucfhrhhomhepmfhrihhsthhofhhfvghrucfjrghughhssggrkhhkuceotghouggvse hkhhgruhhgshgsrghkkhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeevgfelveeikeeg jeeikeeuvefhleeiuddvleegfeekjedtkeevtdetgfffveettdenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegtohguvgeskhhhrghughhssggr khhkrdhnrghmvgdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgu vgeskhhhrghughhssggrkhhkrdhnrghmvgdprhgtphhtthhopehsuhhnshhhihhnvgessh hunhhshhhinhgvtghordgtohhmpdhrtghpthhtohepnhgvfihrvghnsehgmhgrihhlrdgt ohhm X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Oct 2024 15:06:58 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , Eric Sunshine , newren@gmail.com Subject: [PATCH v2 1/2] doc: merge-tree: provide a commit message Date: Tue, 8 Oct 2024 21:06:05 +0200 Message-ID: X-Mailer: git-send-email 2.46.1.641.g54e7913fcb6 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Commit-Hash: b1ca5cae76845f84147d385cc5ff47f219cd471e X-Previous-Commits: fef203471f4492af1468a0c91088324c394effd5 Provide a commit message in the example command. The command will hang since it is waiting for a commit message on stdin. Which is usable but not straightforward enough since this is example code. Signed-off-by: Kristoffer Haugsbakk --- Notes (series): Unlike on some other manuals you probably won’t end up running these commands directly to test things out. But you might end up copying and modifying it when playing around with the command. Documentation/git-merge-tree.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/git-merge-tree.txt b/Documentation/git-merge-tree.txt index 84cb2edf6d0..d1157f1398a 100644 --- a/Documentation/git-merge-tree.txt +++ b/Documentation/git-merge-tree.txt @@ -213,7 +213,8 @@ used as a part of a series of steps such as: NEWTREE=$(git merge-tree --write-tree $BRANCH1 $BRANCH2) test $? -eq 0 || die "There were conflicts..." - NEWCOMMIT=$(git commit-tree $NEWTREE -p $BRANCH1 -p $BRANCH2) + NEWCOMMIT=$(git commit-tree $NEWTREE -F $FILE_WITH_COMMIT_MESSAGE \ + -p $BRANCH1 -p $BRANCH2) git update-ref $BRANCH1 $NEWCOMMIT Note that when the exit status is non-zero, `NEWTREE` in this sequence From patchwork Tue Oct 8 19:06:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristoffer Haugsbakk X-Patchwork-Id: 13826875 Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 532AE21500E for ; Tue, 8 Oct 2024 19:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728414426; cv=none; b=IXluOauP3TpAlnNCpmW9LirKl9sdtm1hpa5v6O70SNLdptCwWILgDlgCJPSvizIOy0H5lzvRX1MeTixqIn1RcPRVCtWatphp6q6ER6/+ZHEAFGq+GSnjElUZfOdKNw00qymUuUCOb6BTe/WiqV5ZsnuPG+olz5x62d55TmvFkjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728414426; c=relaxed/simple; bh=cj+bh4l6FfWUEdgvRJHBumZbZal+7wuQgVZJc1kNJJc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kpins0lYhj3dJgvd0wu3yabyDOShoY47eO8oHVwUMYVB+aqRzaAMpqABqwdjvnKGF8zBTUX1jJ9Eji4M9k7BwxQgF8RW7p0TuUxjW+MYRFunBeAvPb4Mucbgm+RpX8hKh3O8+4KG7CatGe/TNrNbuE2D8o96RNV8fBMBXWlq6No= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=khaugsbakk.name; spf=pass smtp.mailfrom=khaugsbakk.name; dkim=pass (2048-bit key) header.d=khaugsbakk.name header.i=@khaugsbakk.name header.b=B0bGV4I5; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=gslOfFt7; arc=none smtp.client-ip=103.168.172.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=khaugsbakk.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=khaugsbakk.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=khaugsbakk.name header.i=@khaugsbakk.name header.b="B0bGV4I5"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gslOfFt7" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 6D66013803A1; Tue, 8 Oct 2024 15:07:03 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Tue, 08 Oct 2024 15:07:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=khaugsbakk.name; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1728414423; x= 1728500823; bh=g2IBxDjNBq3+PDkfD2d66ftgtG7/JiYrmujlOBEmQ20=; b=B 0bGV4I51/c2TeGmxDwDT/Ye35NnjWjFE6d4dXfto04X0YIK/NAaMConWlcCSA++O 1j11vBu2FRzxVlPF5GGUWzhBowVsqv0N1kAFloVWCu3Wk7yDUMg63O1nm74y6Mxp 3ct5Gwl2pazvUzTItri9TaPZ6rirt7ffZT2QLNRxhDd920iw/8ASbrGVUtTgJ3VM 8sg2WmaqZweNmrLLsP8bq0H2jk9HxmglB5MyN9P3MIKe0JPLaZx/1pT1HCtsVvg5 Wsd/fZ2xHgg3/0zQBPfwU0grnTaI8cBHCyONsqM7M8xqV9MD5hR/vE2fgzZIIQjD N93Jd9B7UsAqLoD6uvvnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728414423; x= 1728500823; bh=g2IBxDjNBq3+PDkfD2d66ftgtG7/JiYrmujlOBEmQ20=; b=g slOfFt7erKgXW6n0rE3XND1oKDBilcPoSGLsejypGVTQxlUqbTiBMNiNDJSg9jrQ BbwywXPSWuNygB8x/nf/CbNVA7PJS66+KxCi01uepk199pwrLV5D7UmwtmAAqPE/ uk5UP5wILWMIjZUPG2tzV2VUcObjc/sSwagzcau8Y/ReeIpXNKQ7BmQiNcwK7LgL mE+pxXjIyw+1E5S0cx4g2nBzkR0N4K3eRMoVl/jT+d8AKUEg0K8P9MWLsPeEf20s hvoQJonsSXasz1fJJODbqbC334HT+kuU3V/3CK5oA/S1Fd/N7UWxYzjASxQzhWd2 uFh3kXzhYc8Mu8fRO81mw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdefuddgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpefmrhhishhtohhffhgvrhcujfgruhhgshgsrghkkhcuoegtohguvgeskh hhrghughhssggrkhhkrdhnrghmvgeqnecuggftrfgrthhtvghrnhepteduieehgedutdfg udevkefhveduieeiteejhfffteeitdegjeeihedthfejgfetnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghouggvsehkhhgruhhgshgsrghk khdrnhgrmhgvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtph htthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheptghouggv sehkhhgruhhgshgsrghkkhdrnhgrmhgvpdhrtghpthhtohepshhunhhshhhinhgvsehsuh hnshhhihhnvggtohdrtghomhdprhgtphhtthhopehnvgifrhgvnhesghhmrghilhdrtgho mh X-ME-Proxy: Feedback-ID: i2671468f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Oct 2024 15:07:01 -0400 (EDT) From: Kristoffer Haugsbakk To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , Eric Sunshine , newren@gmail.com Subject: [PATCH v2 2/2] doc: merge-tree: use || directly Date: Tue, 8 Oct 2024 21:06:06 +0200 Message-ID: <13e0f3bed5dd894ee692c672b301697e0a909e04.1728413450.git.code@khaugsbakk.name> X-Mailer: git-send-email 2.46.1.641.g54e7913fcb6 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Commit-Hash: 13e0f3bed5dd894ee692c672b301697e0a909e04 X-Previous-Commits: 4057d6386125e51fd934f92abd11c62a9d24a832 Use `||` directly since that is more straightforward than checking the last exit status. Also use `echo` and `exit` since `die` is not defined. Signed-off-by: Kristoffer Haugsbakk --- Documentation/git-merge-tree.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/git-merge-tree.txt b/Documentation/git-merge-tree.txt index d1157f1398a..41dfb16476d 100644 --- a/Documentation/git-merge-tree.txt +++ b/Documentation/git-merge-tree.txt @@ -211,8 +211,10 @@ linkgit:git-commit-tree[1], linkgit:git-write-tree[1], linkgit:git-update-ref[1], and linkgit:git-mktag[1]. Thus, it can be used as a part of a series of steps such as: - NEWTREE=$(git merge-tree --write-tree $BRANCH1 $BRANCH2) - test $? -eq 0 || die "There were conflicts..." + NEWTREE=$(git merge-tree --write-tree $BRANCH1 $BRANCH2) || { + echo "There were conflicts..." 1>&2 + exit 1 + } NEWCOMMIT=$(git commit-tree $NEWTREE -F $FILE_WITH_COMMIT_MESSAGE \ -p $BRANCH1 -p $BRANCH2) git update-ref $BRANCH1 $NEWCOMMIT