From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id s+WKKR2ER2FWPwAAgWs5BA (envelope-from ) for ; Sun, 19 Sep 2021 20:40:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gLWgJB2ER2GBEwAA1q6Kng (envelope-from ) for ; Sun, 19 Sep 2021 18:40:29 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 224BE192D0 for ; Sun, 19 Sep 2021 20:40:29 +0200 (CEST) Received: from localhost ([::1]:47046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mS1jo-00085f-73 for larch@yhetil.org; Sun, 19 Sep 2021 14:40:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mS1gW-0003ut-Ht for guix-patches@gnu.org; Sun, 19 Sep 2021 14:37:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mS1gU-0005BG-Ih for guix-patches@gnu.org; Sun, 19 Sep 2021 14:37:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mS1gU-0006AQ-CO for guix-patches@gnu.org; Sun, 19 Sep 2021 14:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50363] [PATCH v3] Improve default diff hunk header detection. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 19 Sep 2021 18:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50363 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50363@debbugs.gnu.org Cc: ludo@gnu.org, maximedevos@telenet.be Received: via spool by 50363-submit@debbugs.gnu.org id=B50363.163207660923685 (code B ref 50363); Sun, 19 Sep 2021 18:37:02 +0000 Received: (at 50363) by debbugs.gnu.org; 19 Sep 2021 18:36:49 +0000 Received: from localhost ([127.0.0.1]:39940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mS1gH-00069x-Cr for submit@debbugs.gnu.org; Sun, 19 Sep 2021 14:36:49 -0400 Received: from out0.migadu.com ([94.23.1.103]:52179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mS1gE-00069n-PF for 50363@debbugs.gnu.org; Sun, 19 Sep 2021 14:36:48 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1632076605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PoAhtwiVR1r6L97YWFzO58zEw1DqC7PRqdCUL7NZTbI=; b=C3vBjZR/kSBTUBmKlEBAU1rUC+yDwierJJKwLzm6HAUFlrTaiHVxFDaxLymUcl3bcByNYq xf8sRv5FlV5fJJP0pL8u3N1wb+t9xPtrKt0tUKwxwYsVKv/ElfoYqMGTyHi5/bzTxoN/7A jy5cXOPcFlYZszrp6qz9qrF2QP1J7ro= From: Sarah Morgensen Date: Sun, 19 Sep 2021 11:36:43 -0700 Message-Id: <58187bb9c61bc7599cde31b52a5dd58e90c1f78f.1632076068.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632076829; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PoAhtwiVR1r6L97YWFzO58zEw1DqC7PRqdCUL7NZTbI=; b=GEx9qFhTeJJLss1QRO09lqKT+RwtbRG5je8891Bu1ebnlzm735RuovX0F2CVI0fg3IeZu1 i0FNpLpiqCb4WNfl2oK13mfeDHTSAuh+0o3M9M+FummiT2ZSqzwt9pxdT0R4htfPmY4neZ jBcEd28yVcf0jO9G3Cmzkh7MsWf+N6yh3+gs3A7TWGPSg8nq/sMyYabog0XtxDtH67pKAa 8XZFRiXHCTseyfKKw1uooAYv1iY8sGuyKWDt/fIMilmrD55pyPvEBdMlQfxT960fPas4kz K9ob1W/5rTmrqQbTRIoKqvc/ZdlTJ4h3up9RomDK9/0VNmlVDoe5H558Z33U+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632076829; a=rsa-sha256; cv=none; b=SR8zNbboTMIURWaOrhu1IAuYr4gYUfYuQEdC8ZgXm4fiOu0FPZWseCRgrZfOrg8PUXhg9g eOKCH3Q7kLvibCvZksTA08MacLutNWUOq2ErGFaHj0qSNNeISOzFMYCa7pRjzTY0elUBta IPtOthlJUejjE/91jlcIr7uEyBGup/l9n9JVI66fzqnu2Hn271Rr4n5O8uMTdc1IKYYZsN Zpn5+2uMvHdm3kDXfto4DFBs+dLrNIZenCm9CVRyhic1SvI2am2EO7Xo0Ur5BI19vf99YD esDkttEbrdA8p8yzE0/ipYwcj9DfBx030f6kKB0+gXlHSlWxGrro+TgZI5F0ow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b="C3vBjZR/"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.71 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b="C3vBjZR/"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 224BE192D0 X-Spam-Score: 3.71 X-Migadu-Scanner: scn0.migadu.com X-TUID: SVjXSc6GRYHc Tell git where to look for diff hunk headers: top-level definitions for Scheme files, and (sub)section headers for texi files. * .gitattributes, etc/git/gitconfig: New files. * doc/contributing.texi ("Submitting Patches"): Add subsection "Configuring Git". Document etc/git/gitconfig. --- Changes from previous version: * Added rule for .texi files * Documented how to use the advanced settings in the manual (as well as some other related information) Note that I am currently working on a rewrite of "Submitting Patches", so "Configuring Git" will eventually get its own proper subsection. -- Sarah .gitattributes | 3 +++ doc/contributing.texi | 46 +++++++++++++++++++++++++++++++++++++++---- doc/guix.texi | 1 + etc/git/gitconfig | 5 +++++ 4 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 .gitattributes create mode 100644 etc/git/gitconfig diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..51f29b8a48 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.scm diff=scheme +*.scm.in diff=scheme +*.texi diff=tex diff --git a/doc/contributing.texi b/doc/contributing.texi index d1b77d7d05..0e8747ab25 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -992,9 +992,12 @@ @section Submitting Patches Development is done using the Git distributed version control system. Thus, access to the repository is not strictly necessary. We welcome contributions in the form of patches as produced by @code{git -format-patch} sent to the @email{guix-patches@@gnu.org} mailing list. -Seasoned Guix developers may also want to look at the section on commit -access (@pxref{Commit Access}). +format-patch} sent to the @email{guix-patches@@gnu.org} mailing list +(@pxref{submitting patches,, Submitting patches to a project, git, Git +User Manual}). Contributors are encouraged to take a moment to set some +Git repository options (@pxref{Configuring Git}) first, which can +improve the readability of patches. Seasoned Guix developers may also +want to look at the section on commit access (@pxref{Commit Access}). This mailing list is backed by a Debbugs instance, which allows us to keep track of submissions (@pxref{Tracking Bugs and Patches}). Each @@ -1205,11 +1208,46 @@ @section Submitting Patches When a bug is resolved, please close the thread by sending an email to @email{@var{NNN}-done@@debbugs.gnu.org}. +@node Configuring Git +@subsection Configuring Git +@cindex git configuration +@cindex @code{git format-patch} +@cindex @code{git send-email} + +If you have not done so already, you may wish to set a name and email +that will be associated with your commits (@pxref{telling git your name, +, Telling Git your name, git, Git User Manual}). If you wish to use a +different name or email just for commits in this respository, you can +use @command{git config --local}, or edit @file{.git/config} in the +repository instead of @file{~/.gitconfig}. + +We provide some default settings in @file{etc/git/gitconfig} which +modify how patches are generated, making them easier to read and apply. +These settings can be applied by manually copying them to +@file{.git/config} in your checkout, or by telling Git to include the +whole file: + +@example +git config --local include.path=../etc/git/gitconfig +@end example + +From then on, any changes to @file{etc/git/gitconfig} would +automatically take effect. + +Since the first patch in a series must be sent separately +(@pxref{Sending a Patch Series}), it can also be helpful to tell +@command{git format-patch} to handle the e-mail threading instead of +@command{git send-email}: + +@example +git config --local format.thread=shallow +git config --local sendemail.thread=no +@end example + @unnumberedsubsec Sending a Patch Series @anchor{Sending a Patch Series} @cindex patch series @cindex @code{git send-email} -@cindex @code{git-send-email} When sending a patch series (e.g., using @code{git send-email}), please first send one message to @email{guix-patches@@gnu.org}, and then send diff --git a/doc/guix.texi b/doc/guix.texi index 6436e83a7c..4dac36310f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -96,6 +96,7 @@ Copyright @copyright{} 2021 Hui Lu@* Copyright @copyright{} 2021 pukkamustard@* Copyright @copyright{} 2021 Alice Brenon@* +Copyright @copyright{} 2021 Sarah Morgensen@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or diff --git a/etc/git/gitconfig b/etc/git/gitconfig new file mode 100644 index 0000000000..290006816f --- /dev/null +++ b/etc/git/gitconfig @@ -0,0 +1,5 @@ +[diff "scheme"] + xfuncname = "^(\\(define.*)$" + +[diff "tex"] + xfuncname = "^(@((|sub|subsub)section|(unnumbered|appendix)((|sub|subsub)sec)|(|major|chap|sub|subsub)heading|chapter|part|titlepage|top)[ \t]+.*)$" base-commit: 808f9ffbd3106da4c92d2367b118b98196c9e81e -- 2.33.0