Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCOG8-0006ZS-05 for pgsql-novice@arkaria.postgresql.org; Fri, 15 Jul 2022 16:33:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oCOG6-0008CE-Sb for pgsql-novice@arkaria.postgresql.org; Fri, 15 Jul 2022 16:33:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCOG6-0008C5-Ke for pgsql-novice@lists.postgresql.org; Fri, 15 Jul 2022 16:33:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCOG0-0005la-6x for pgsql-novice@lists.postgresql.org; Fri, 15 Jul 2022 16:33:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26FGXYKe3401797; Fri, 15 Jul 2022 12:33:34 -0400 From: Tom Lane To: mahendrakar s cc: pgsql-novice Subject: Re: best way to apply and work on the patches of the pg community In-reply-to: References: Comments: In-reply-to mahendrakar s message dated "Fri, 15 Jul 2022 21:03:04 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3401795.1657902814.1@sss.pgh.pa.us> Date: Fri, 15 Jul 2022 12:33:34 -0400 Message-ID: <3401796.1657902814@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk mahendrakar s writes: > I would like to work on a patch published on hackers community( patch is > from June, 2021). I cloned postgres code and tried to apply the patch and > got errors. > *patch -p1 < ../0001-auth-generalize-SASL-mechanisms.patch* > patching file src/backend/libpq/auth-scram.c > Hunk #1 FAILED at 101. > Hunk #2 FAILED at 170. > Hunk #3 FAILED at 199. > Hunk #4 FAILED at 215. > Hunk #5 FAILED at 325. > Can you please let me know what is the recommended way to apply the patches > for me to begin the work? "patch -p1" is the way that usually works the best for me. My guess here is that the patch in question is out of date and will need manual adjustment to apply to HEAD. There have been some pretty significant changes in that code in the last year, eg 9fd85570d. Sometimes --ignore-whitespace helps, but I doubt that's the main problem in this case. regards, tom lane