From patchwork Thu Oct 12 21:09:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Blau X-Patchwork-Id: 13419821 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 C549E3E474 for ; Thu, 12 Oct 2023 21:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ttaylorr-com.20230601.gappssmtp.com header.i=@ttaylorr-com.20230601.gappssmtp.com header.b="xLjjiahG" Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7997C9D for ; Thu, 12 Oct 2023 14:09:28 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-77574c2cffdso119343785a.0 for ; Thu, 12 Oct 2023 14:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ttaylorr-com.20230601.gappssmtp.com; s=20230601; t=1697144967; x=1697749767; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+I6NYbABdM+77+APG7gv6fXgIFEGwOyElEoe0rWZ9NI=; b=xLjjiahGx6s7xLuecuvQbAH9CiMIysIGRHBOgzApnZY5h1KEb9MdbupBow6J9WdUaH bxMju/86lazvMBdnshoB4QKj3YrC/Qa2KA7uR0hyGIoxDJaJLW5pZFLVqYCjofTTPMmQ repdibcubWRNogwKFxCQP41B3ca3NILOmsMcMzj8lh2lJQ9nwUWt5HfFe9J2PJ4kysaU D8JaoLTO6uEZfKLKSfyVYSLVQ/A7lxpFksCaaetPFnmy9/imckXzH7iFLfVgLxLq46ta vf2Fs84LLVZOkDAgFDqwSo4rfjXgFiG+e5NIgBVe5ZFSk/gvzh42bp8E8apNqCwfosE7 6K0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697144967; x=1697749767; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+I6NYbABdM+77+APG7gv6fXgIFEGwOyElEoe0rWZ9NI=; b=WUsXgUdkfblbee6AmLPlFSrpBSN2afpvtL6xnBWLPQzTXyGyEdjmHdiyE6TjlhFl7X aFXMr3R+sKuStsMyzx76XneJKAeY4jioGV6r23ID4JgtlTdub5tH5/T+FNkM+VculwAs +bLpNTSkPH9nU4oHATiiH/FOnHH5vfTEhIgYOCJPo+jGufygFjCP/a9KtNqWkxL5/t40 lIjIYzW+i0KriO9xgPhSUh8imNtOSL+xc6E+pQY78YsUIBVY8qJNi3Upa/UI5JxGPlj2 RKLV5ZJQtXhimxkxaBja4TRKrw5ublWr9rb9GcEjSwuLruAA3cdIX0K1inUR/UrIRIfd rgZg== X-Gm-Message-State: AOJu0YyC/B085+zoJV0yZRl+11b3DKhkgoCYCfKVLhKv+clckfGW59WK M/UQA+MdUwlszUZ+acbbz1sW/5nwhczMZ1/4agOTXg== X-Google-Smtp-Source: AGHT+IEixcmUV06STer5kJyT/Kc+CyEHSivDersfa/Yi4WPnmC4pcVoLvXPzVRPV0tlE++anoGmWcg== X-Received: by 2002:a05:620a:19a4:b0:767:8546:b374 with SMTP id bm36-20020a05620a19a400b007678546b374mr28583131qkb.14.1697144967474; Thu, 12 Oct 2023 14:09:27 -0700 (PDT) Received: from localhost (104-178-186-189.lightspeed.milwwi.sbcglobal.net. [104.178.186.189]) by smtp.gmail.com with ESMTPSA id o4-20020a05620a110400b007757eddae8bsm95578qkk.62.2023.10.12.14.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 14:09:27 -0700 (PDT) Date: Thu, 12 Oct 2023 17:09:25 -0400 From: Taylor Blau To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King Subject: [PATCH 1/2] Documentation/gitformat-pack.txt: fix typo Message-ID: <8c5fa1ff4f1fc069094b5acbc70cd0808742fd24.1697144959.git.me@ttaylorr.com> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net e0d1bcf825 (multi-pack-index: add format details, 2018-07-12) describes the MIDX's "PNAM" chunk as having entries which are "null-terminated strings". This is a typo, as strings are terminated with a NUL character, which is a distinct concept from "NULL" or "null", which we typically reserve for the void pointer to address 0. Correct the documentation accordingly. Signed-off-by: Taylor Blau --- Documentation/gitformat-pack.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitformat-pack.txt b/Documentation/gitformat-pack.txt index 870e00f298..d7153962d4 100644 --- a/Documentation/gitformat-pack.txt +++ b/Documentation/gitformat-pack.txt @@ -390,7 +390,7 @@ CHUNK LOOKUP: CHUNK DATA: Packfile Names (ID: {'P', 'N', 'A', 'M'}) - Stores the packfile names as concatenated, null-terminated strings. + Stores the packfile names as concatenated, NUL-terminated strings. Packfiles must be listed in lexicographic order for fast lookups by name. This is the only chunk not guaranteed to be a multiple of four bytes in length, so should be the last chunk for alignment reasons. From patchwork Thu Oct 12 21:09:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Blau X-Patchwork-Id: 13419822 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 0E3DB3E473 for ; Thu, 12 Oct 2023 21:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ttaylorr-com.20230601.gappssmtp.com header.i=@ttaylorr-com.20230601.gappssmtp.com header.b="n1kU9SS/" Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A314E1 for ; Thu, 12 Oct 2023 14:09:34 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-5a7c93507d5so16899597b3.2 for ; Thu, 12 Oct 2023 14:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ttaylorr-com.20230601.gappssmtp.com; s=20230601; t=1697144973; x=1697749773; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZcLh9qbfjxTXEYzJQLtfphbDYwtd321Gp2hF8Gr1cMg=; b=n1kU9SS/BLxfJQ0zYJ8mh6DiS2OxnGrJo38rlTEJzlD9kh7wTJm8JF6GD11/ILMFGr 5XURTDF9qdfWQFwNYPCzfrnj3ik+X/33q9E0YRJf2pEiNuETS3WufGP0Vm5SUG+H5dxc exnUJewwNGhgKFD0/cp4XozJgPq/nGZVyOoFaRGcvOdSOgVErCUkkaNMuaz6yRt172dJ Sbqa2ZrCCl68aITkeGjawSjtt34SEdOVQnFruJJo4pmuiU5m/tODyNbD4F7LKCKznFPx aKJ26xlPXqcINw2XnJTH6uMhgDPYENlP/dHqgHXbbwUi+Mk2YXUA//rtG6gsS9BYdZZ2 DJ9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697144973; x=1697749773; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZcLh9qbfjxTXEYzJQLtfphbDYwtd321Gp2hF8Gr1cMg=; b=AIb0gO8ffsgZ4owUrQvcdqAsiH5T/uyCz1e/H9JHbM//VMUnNDe5OQs/NtK0rVk/zn /K71ZyYO+3AP19B/qeDOSkURwjkUJalb+f7YTY6wxm5SgvFTdAUEUfN5b2L8L5/35UKK s8To29hVKNBJvgRJ+/SCOcUjWgiJNm5Iq6ueb3uglVXU4phxNqjGrRFDuhctcbjPVhnq 94y41eZzTmLD2YJHIJd0G715Dbbfl9hAkbG0RrTdx+wipE1m+CPW38Y68nB9elA2OfrX 91mFPMYRZsRS+7x8oBQ9McxaHgPG5ROqxLCRj+6m708wH97IOxU7Z+Pl+3hIkRlyb7uk 2LXw== X-Gm-Message-State: AOJu0YyIz2qiPSIHvhqHuoaOvUfQhxQ71HDOxIiAEBM/lbfEjAetj7Ud AsyzVGhtBx4EpjgeEi1+dr4EG5AX+FFBJtx5ibsv9w== X-Google-Smtp-Source: AGHT+IHyyorpLaBFED0awuhNF3K9YiP6iIt4LiimAM8TLhxFpxfcawqSEmXTFKKGP0rnhcXJWqFAdA== X-Received: by 2002:a25:b34c:0:b0:d9a:5666:7ab5 with SMTP id k12-20020a25b34c000000b00d9a56667ab5mr9029411ybg.10.1697144973082; Thu, 12 Oct 2023 14:09:33 -0700 (PDT) Received: from localhost (104-178-186-189.lightspeed.milwwi.sbcglobal.net. [104.178.186.189]) by smtp.gmail.com with ESMTPSA id m15-20020ae9e70f000000b007671b599cf5sm94231qka.40.2023.10.12.14.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 14:09:32 -0700 (PDT) Date: Thu, 12 Oct 2023 17:09:31 -0400 From: Taylor Blau To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King Subject: [PATCH 2/2] Documentation/gitformat-pack.txt: fix incorrect MIDX documentation Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Back in 32f3c541e3 (multi-pack-index: write pack names in chunk, 2018-07-12) the MIDX's "Packfile Names" (or "PNAM", for short) chunk was described as containing an array of string entries. e0d1bcf825 notes that this is the only chunk in the MIDX format's specification that is not guaranteed to be 4-byte aligned, and so should be placed last. This isn't quite accurate: the entries within the PNAM chunk are not guaranteed to be aligned since they are arbitrary strings, but the chunk itself is aligned since the ending is padded with NUL bytes. That external padding has always been there since 32f3c541e3 via midx.c::write_midx_pack_names(), which ended with: i = MIDX_CHUNK_ALIGNMENT - (written % MIDX_CHUNK_ALIGNMENT) if (i < MIDX_CHUNK_ALIGNMENT) { unsigned char padding[MIDX_CHUNK_ALIGNMENT]; memset(padding, 0, sizeof(padding)) hashwrite(f, padding, i); written += i; } In fact, 32f3c541e3's log message itself describes the chunk in its first paragraph with: Since filenames are not well structured, add padding to keep good alignment in later chunks. So these have always been externally aligned. Correct the corresponding part of our documentation to reflect that. Signed-off-by: Taylor Blau --- Documentation/gitformat-pack.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/gitformat-pack.txt b/Documentation/gitformat-pack.txt index d7153962d4..54000c9412 100644 --- a/Documentation/gitformat-pack.txt +++ b/Documentation/gitformat-pack.txt @@ -392,8 +392,9 @@ CHUNK DATA: Packfile Names (ID: {'P', 'N', 'A', 'M'}) Stores the packfile names as concatenated, NUL-terminated strings. Packfiles must be listed in lexicographic order for fast lookups by - name. This is the only chunk not guaranteed to be a multiple of four - bytes in length, so should be the last chunk for alignment reasons. + name. Individual entries in this chunk are not guarenteed to be + aligned. The chunk is externally padded with zeros to align + remaining chunks. OID Fanout (ID: {'O', 'I', 'D', 'F'}) The ith entry, F[i], stores the number of OIDs with first