From patchwork Fri Aug 14 12:21:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11714485 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CBEE16B1 for ; Fri, 14 Aug 2020 12:22:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F888221E2 for ; Fri, 14 Aug 2020 12:22:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qk3Ar1v6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726925AbgHNMWF (ORCPT ); Fri, 14 Aug 2020 08:22:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgHNMWE (ORCPT ); Fri, 14 Aug 2020 08:22:04 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A5DCC061384 for ; Fri, 14 Aug 2020 05:22:04 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id v12so9696588ljc.10 for ; Fri, 14 Aug 2020 05:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R5B2vz66G1bqnebgNJLoVE8Y2qzFWozqbZXtUALszOU=; b=Qk3Ar1v690iwowtkkNqK50SWlMzqmwsLpKM81nYTCLMeE9STA635q5KlhgX4j+iGNJ qlEZKq2NndGYSMsqabHW32vfpZ0C+ekCbr3fKpZsmcIsXRL9E4bWhQdqXunMEVD6a3QY J5+IYakRe8YQtQnaVUAZgdvXXbNcEZNSXHFvLpc+7KDmeV+wcHdcJX1sW6hEId76cEKT McxLY8vJ+JYADF9B1Vc9Um63JLqR8SQK6keUCzkbBkjlL2L5sXdaHA+qJuQeYN5etcRB hIcIcTVSTTi2nk1mFrO3MeiI6HY3juFY4XTB9p1ose9aeSqd7fE98OU/R4qugeFEiQoj WYPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R5B2vz66G1bqnebgNJLoVE8Y2qzFWozqbZXtUALszOU=; b=DF8K4eVryNzYzjYsoPaL5cdX4aEAPqP2ow+tKaoKUF4DS42ThVaj32nS7gONU/7JcZ E48ReYkqJ+pMiPBDNdTOwMJMGWRdQ+1m+HSueyi50sqIr3MePuvoK7rPVvgkoruNVSy9 Hely/w0nlxgzdAl1cz9MGppsDwLK/3HRE4xzAB4cK1IC2K0aLJEOUxAMUkkAJUmNrm4p PkZVU6rfeH13MD5mMvQmP9GsMjJbdHDy5BcwwIBhBK71C5RXFlOUpnYWo636a11S9Vyv HHou7fLw/04m2oLSTVSBvWF2iJWcbNqk49cWTJ3LSUU3NfuDh6tiST0OxWP7+KgwPBm9 H7EA== X-Gm-Message-State: AOAM532XrQelxA8+hYWavFGKVJvcNo/tbAeK8QGVWmi0axLfZrnMFgK8 onaHM8txEEUp2tYW98FYaUk= X-Google-Smtp-Source: ABdhPJzChDsMZfspQqD8U9tmDfecRGQ0emAmXEildekaExzYQCcJkVcwpEdE8zK4V4cNHHcByKsZxQ== X-Received: by 2002:a2e:9842:: with SMTP id e2mr1244448ljj.88.1597407722695; Fri, 14 Aug 2020 05:22:02 -0700 (PDT) Received: from localhost.localdomain (92-33-153-30.customers.ownit.se. [92.33.153.30]) by smtp.gmail.com with ESMTPSA id o2sm1847407lfi.50.2020.08.14.05.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 05:22:02 -0700 (PDT) From: =?utf-8?q?Martin_=C3=85gren?= To: "brian m. carlson" Cc: git@vger.kernel.org, Derrick Stolee , Junio C Hamano Subject: [PATCH 1/5] http-protocol.txt: document SHA-256 "want"/"have" format Date: Fri, 14 Aug 2020 14:21:42 +0200 Message-Id: <5590a68c5ba7081cd7e64c708b5c25db23f5e95b.1597406877.git.martin.agren@gmail.com> X-Mailer: git-send-email 2.28.0.277.g9b3c35fffd In-Reply-To: References: <20200813224901.2652387-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Document that in SHA-1 repositories, we use SHA-1 for "want"s and "have"s, and in SHA-256 repositories, we use SHA-256. Signed-off-by: Martin Ågren --- Documentation/technical/http-protocol.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/technical/http-protocol.txt b/Documentation/technical/http-protocol.txt index 51a79e63de..507f28f9b3 100644 --- a/Documentation/technical/http-protocol.txt +++ b/Documentation/technical/http-protocol.txt @@ -401,8 +401,9 @@ at all in the request stream: The stream is terminated by a pkt-line flush (`0000`). A single "want" or "have" command MUST have one hex formatted -SHA-1 as its value. Multiple SHA-1s MUST be sent by sending -multiple commands. +object name as its value. Multiple object names MUST be sent by sending +multiple commands. (An object name is a SHA-1 hash in a SHA-1 repo +and a SHA-256 hash in a SHA-256 repo.) The `have` list is created by popping the first 32 commits from `c_pending`. Less can be supplied if `c_pending` empties. From patchwork Fri Aug 14 12:21:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11714495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F47E722 for ; Fri, 14 Aug 2020 12:22:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 660EB20B1F for ; Fri, 14 Aug 2020 12:22:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bazBWcTZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726982AbgHNMWM (ORCPT ); Fri, 14 Aug 2020 08:22:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbgHNMWG (ORCPT ); Fri, 14 Aug 2020 08:22:06 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CCFBC061384 for ; Fri, 14 Aug 2020 05:22:06 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id j22so4721928lfm.2 for ; Fri, 14 Aug 2020 05:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tfmhAfPmIVuMWkZ16DBb8rYS5b1h4XnU3c5h04A27X0=; b=bazBWcTZXU/pz1eClRxYjZ+Q3Bj+vv2kvZnlfl2/LowIcjJm4WvaUDl1iQEgvAVgRh wd+9t9Q3IKBuq+Iucna0ECcn8yVkrY2GpFlQGv9qcmw7Z4PIhr2tKJNwrXi5Fd6DoZs3 iQPWwlEp1IXbVKmBK4AisR+vQ1pbdUUKbCuARptPfH742mWdlHw+9IrcGBQSI4ww0Mwo 8wNNWskUt7HykNtZQ3zj5BsqrxYqnZMU2fMRy2gPZ4iR9n1YFuaTg7T6Wt+lxC972Tvl OQ73R9/Ymdj94EOTYj2Z6Hgr30CvJ1KPNxYCpTixls3NS0ZK7Ss4htfl4ZhtTVyu+/o8 W8CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tfmhAfPmIVuMWkZ16DBb8rYS5b1h4XnU3c5h04A27X0=; b=Qf154ODQQqRTBRaY2AZaajPkUdD2EbO2uHD6RkSX3+mH2z3I0Pi6N1kuh4ovDBqaUh SgdXoesF4u8EC3+iZP+0ewHjh+c7DndxQgR0Po/7oepRJ08WC8S/gwge7dBRv8FEFHRo KYPvR/rX8xOJsokGPN36xwnGw/v4+CSotOCH8z+2O0tO6AABTzQUw+COFhX+gvFzhiXM DpxeNUeCozyYSkypUaD7GWYEHfEg4nvDzh+lQnLvR9mH2VAU8mzjV6FYS4fcO1d3iLNG VqVAUirL+YFrQNi59JLED5VB9979qzN0aElSdiIH4cO2ixu4/QCREXD7Sm0CBGk9OtBN VoSw== X-Gm-Message-State: AOAM531Rho67p0q3gKYVfu7kMCJSrh2d4dpSfQlIPKIk6UOJPM9dkme7 PnOeDe/pdO+PNXEFySEj2JoZ12rbig0= X-Google-Smtp-Source: ABdhPJx7HEhSu5qS0rjraKh350loiiH7gGDQfgCHJSHDHIQnfXF6JzRbqvQ+gPRRbn9mbCvnT4nPOQ== X-Received: by 2002:a19:c6c6:: with SMTP id w189mr1130025lff.75.1597407724529; Fri, 14 Aug 2020 05:22:04 -0700 (PDT) Received: from localhost.localdomain (92-33-153-30.customers.ownit.se. [92.33.153.30]) by smtp.gmail.com with ESMTPSA id o2sm1847407lfi.50.2020.08.14.05.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 05:22:04 -0700 (PDT) From: =?utf-8?q?Martin_=C3=85gren?= To: "brian m. carlson" Cc: git@vger.kernel.org, Derrick Stolee , Junio C Hamano Subject: [PATCH 2/5] index-format.txt: document SHA-256 index format Date: Fri, 14 Aug 2020 14:21:43 +0200 Message-Id: X-Mailer: git-send-email 2.28.0.277.g9b3c35fffd In-Reply-To: References: <20200813224901.2652387-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Similar to a recent commit, document that in SHA-1 repositories, we use SHA-1 and in SHA-256 repositories, we use SHA-256, then replace all other uses of "SHA-1" with something more neutral. Signed-off-by: Martin Ågren --- Documentation/technical/index-format.txt | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt index faa25c5c52..827ece2ed1 100644 --- a/Documentation/technical/index-format.txt +++ b/Documentation/technical/index-format.txt @@ -3,8 +3,11 @@ Git index format == The Git index file has the following format - All binary numbers are in network byte order. Version 2 is described - here unless stated otherwise. + All binary numbers are in network byte order. + In a repository using the traditional SHA-1, checksums and object IDs + (object names) mentioned below are all computed using SHA-1. Similarly, + in SHA-256 repositories, these values are computed using SHA-256. + Version 2 is described here unless stated otherwise. - A 12-byte header consisting of @@ -32,7 +35,7 @@ Git index format Extension data - - 160-bit SHA-1 over the content of the index file before this + - 160-bit hash checksum over the content of the index file before this checksum. == Index entry @@ -80,7 +83,7 @@ Git index format 32-bit file size This is the on-disk size from stat(2), truncated to 32-bit. - 160-bit SHA-1 for the represented object + 160-bit object name for the represented object A 16-bit 'flags' field split into (high to low bits) @@ -211,8 +214,8 @@ Git index format The extension consists of: - - 160-bit SHA-1 of the shared index file. The shared index file path - is $GIT_DIR/sharedindex.. If all 160 bits are zero, the + - Hash of the shared index file. The shared index file path + is $GIT_DIR/sharedindex.. If all bits are zero, the index does not require a shared index file. - An ewah-encoded delete bitmap, each bit represents an entry in the @@ -253,10 +256,10 @@ Git index format - 32-bit dir_flags (see struct dir_struct) - - 160-bit SHA-1 of $GIT_DIR/info/exclude. Null SHA-1 means the file + - Hash of $GIT_DIR/info/exclude. A null hash means the file does not exist. - - 160-bit SHA-1 of core.excludesfile. Null SHA-1 means the file does + - Hash of core.excludesfile. A null hash means the file does not exist. - NUL-terminated string of per-dir exclude file name. This usually @@ -285,13 +288,13 @@ The remaining data of each directory block is grouped by type: - An ewah bitmap, the n-th bit records "check-only" bit of read_directory_recursive() for the n-th directory. - - An ewah bitmap, the n-th bit indicates whether SHA-1 and stat data + - An ewah bitmap, the n-th bit indicates whether hash and stat data is valid for the n-th directory and exists in the next data. - An array of stat data. The n-th data corresponds with the n-th "one" bit in the previous ewah bitmap. - - An array of SHA-1. The n-th SHA-1 corresponds with the n-th "one" bit + - An array of hashes. The n-th hash corresponds with the n-th "one" bit in the previous ewah bitmap. - One NUL. @@ -330,12 +333,12 @@ The remaining data of each directory block is grouped by type: - 32-bit offset to the end of the index entries - - 160-bit SHA-1 over the extension types and their sizes (but not + - Hash over the extension types and their sizes (but not their contents). E.g. if we have "TREE" extension that is N-bytes long, "REUC" extension that is M-bytes long, followed by "EOIE", then the hash would be: - SHA-1("TREE" + + + Hash("TREE" + + "REUC" + ) == Index Entry Offset Table From patchwork Fri Aug 14 12:21:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11714491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0895316B1 for ; Fri, 14 Aug 2020 12:22:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF82B22B45 for ; Fri, 14 Aug 2020 12:22:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QPWSbJIB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727062AbgHNMWN (ORCPT ); Fri, 14 Aug 2020 08:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgHNMWK (ORCPT ); Fri, 14 Aug 2020 08:22:10 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4583DC061385 for ; Fri, 14 Aug 2020 05:22:08 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id m22so9692135ljj.5 for ; Fri, 14 Aug 2020 05:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bCmRfWf3V5Z8kL7hlwU6HQ2D31NYOkEfTR37ogrKfxE=; b=QPWSbJIB+jI03tmP/Jdb0uPslF4C43GGUYydV8HPUsU+qqzBOaeQkXnvMErUgqxfCF DHCbU1I+CmCicsQoUs5kAq22+/1TJktSm2d6v4gDji2GEqcJFfgh7KMSBsUO98SBm1/A 6hrA5Ne6Yc7ix350LVYBH5DDEDNfgJm3EvuJWXPMUg51RdHMqVwCHM/KIMc6V/ZNlJmt OefkN6n73uiHrOMlnhyYnhV9eH+nmD1ePHMPqPiM/uZZLvLFTCJsZCyv6WvyhWP3i7I+ iwqSAmeGdGr306IgHdDsijHh4kbyjto2TJphKN25FfFrqf8XxquccKEayuldh6duUrk9 T9Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bCmRfWf3V5Z8kL7hlwU6HQ2D31NYOkEfTR37ogrKfxE=; b=gd1cKeBoP9iyG0SIfPXaP2xB5Lh22MXtbDUebd3Djm59aSMAtsBzn+9eA3Ke0VUxnX RZosQc+PMfEHmkCZCHj/oMRyU/OfwHUckDXARE92geOqyOd4+jrP1XlwCqgJznTp1nbp xjTGVlN5mQM2CIbh/NKn1uYb434HPymKTTOmSiUt/7pclgZZV3IAq6kuYTcRppjiWeEy Kud83YSeLklS/u105ZRCozOpFRSn79qYpp3Qzql+FRiNmkKA4ihu3f1U6N4m2i2xGL1x pAyC1GBcbm79rGNKjGms96Uv4fNCEpuzOJsWsKJVUzI4TAjg+N0/eNVAWVL8QEwt7/XD zwLQ== X-Gm-Message-State: AOAM530HMMX5DaTaCyosi+tofAnaLaVwlHeCc9qWRJwd2AOele3Lebq9 2k5nT7HcFI1g9Hz5L5pmR+3dxtzMk+s= X-Google-Smtp-Source: ABdhPJz1jmZIOWJAVmhRPFZIc2KIJ5BH1+BHcw5ExlQLkGPXOXVKiaJPluun9dgAmCg4zLq98XWiIA== X-Received: by 2002:a2e:a58a:: with SMTP id m10mr1122441ljp.247.1597407726748; Fri, 14 Aug 2020 05:22:06 -0700 (PDT) Received: from localhost.localdomain (92-33-153-30.customers.ownit.se. [92.33.153.30]) by smtp.gmail.com with ESMTPSA id o2sm1847407lfi.50.2020.08.14.05.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 05:22:06 -0700 (PDT) From: =?utf-8?q?Martin_=C3=85gren?= To: "brian m. carlson" Cc: git@vger.kernel.org, Derrick Stolee , Junio C Hamano Subject: [PATCH 3/5] protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256 Date: Fri, 14 Aug 2020 14:21:44 +0200 Message-Id: <13798dfb121c9631e9d811f5f74f9a78c1fcfdf9.1597406877.git.martin.agren@gmail.com> X-Mailer: git-send-email 2.28.0.277.g9b3c35fffd In-Reply-To: References: <20200813224901.2652387-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Two of our extensions contain "sha1" in their names, but that's historical. The "want"s will take object names that are not necessarily SHA-1s. Make this clear, but also make it clear how there's still just one correct hash algo: These extensions don't somehow make the "want"s take object names derived using *any* hash algorithm. Signed-off-by: Martin Ågren --- Documentation/technical/protocol-capabilities.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/technical/protocol-capabilities.txt b/Documentation/technical/protocol-capabilities.txt index 36ccd14f97..47f1b30090 100644 --- a/Documentation/technical/protocol-capabilities.txt +++ b/Documentation/technical/protocol-capabilities.txt @@ -324,15 +324,18 @@ allow-tip-sha1-in-want ---------------------- If the upload-pack server advertises this capability, fetch-pack may -send "want" lines with SHA-1s that exist at the server but are not -advertised by upload-pack. +send "want" lines with object names that exist at the server but are not +advertised by upload-pack. (Note that the name of the capability +contains "sha1", but that it's more general than that: in SHA-1 +repositories, the "want" lines provide SHA-1 values, but in SHA-256 +repositories, they provide SHA-256 values.) allow-reachable-sha1-in-want ---------------------------- If the upload-pack server advertises this capability, fetch-pack may -send "want" lines with SHA-1s that exist at the server but are not -advertised by upload-pack. +send "want" lines with object names that exist at the server but are not +advertised by upload-pack. (Same remark about "sha1" as above.) push-cert= ----------------- From patchwork Fri Aug 14 12:21:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11714489 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B93C3722 for ; Fri, 14 Aug 2020 12:22:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C4A3221E2 for ; Fri, 14 Aug 2020 12:22:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mDkVmKlD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbgHNMWM (ORCPT ); Fri, 14 Aug 2020 08:22:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbgHNMWM (ORCPT ); Fri, 14 Aug 2020 08:22:12 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877DDC061386 for ; Fri, 14 Aug 2020 05:22:11 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id s9so4715600lfs.4 for ; Fri, 14 Aug 2020 05:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DBD5tT1QKYeTEt2trXkgCkA1cQ8K9QrkZC+S63ymft0=; b=mDkVmKlD+lmTTLRkeB1aUnsJWOSrNNWm7+OoHMZeMuU/dnr2CSCj3sa9DNsY/IYwzZ x400mCkffP5Ls0Qku/lQkUiTsijLfVft8RGJJGdvxH7Wbk2EMDzp1TrJgh4mQIGrT79x ctnOqVJ3D9zkxem0NAMWqJ/O3hGaI/QyRS+G+tR7kkU0bXd6nkmlB5UL4q4LFI7pQAy7 +LuzZoD1eZdoMHFl0mr8157XxBQVEoOcA82PU00ci6DqwyMEznBPHZE9asGQZAtYaySp wK8iBdeqaKI18Ep1f79HB01ZAOkx0PLfEBdRStv22SSe+624WkVXO6S5vFWKK6WdxPtY lbVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DBD5tT1QKYeTEt2trXkgCkA1cQ8K9QrkZC+S63ymft0=; b=Pw8wSdzkSeBzNeAcIb781Wi2/+v1HJbcTIHI/2USugkrGmbCvsgXzE7jnxAnN0+y9q e4IzU0nT9KLPVe+3Q5wqLqkMwukrT0wkaBhZJDKVZDrxpkuDMWiQMdeSZSz7Ss63IptA oJ6xRmocj6E+D5P34JXnIDLKAvQbjUWTv6fSUVGrvILlOTdODAAdvZmAlLZcng5NK/JW +8WCX6e9j032y2de4GCjnOTlzpJMY//Dfa+9vUl+mgaM+8bxkzI2GkUSZW84z2ioz2RC 3InPMkiaGiPt/F7mbGj0Q4jhuMH0ugNotkuphlkQ9i5RLvgKARNgW4ud99wzSWaFgk9s RnPA== X-Gm-Message-State: AOAM531ZqoAIEAkkjuzGmNKQacBABYCSA3ayTogMTH16zIAiTAIzCpWm T+aQBZ8IFegdHGAeHqJAD3E= X-Google-Smtp-Source: ABdhPJx2NV40vPhnydtdVfwn191gs8KFSuleJVsSyWosPa63S/Y+60h9VQb7q1auWJj5UN661zrgDw== X-Received: by 2002:a05:6512:312b:: with SMTP id p11mr1119157lfd.202.1597407728660; Fri, 14 Aug 2020 05:22:08 -0700 (PDT) Received: from localhost.localdomain (92-33-153-30.customers.ownit.se. [92.33.153.30]) by smtp.gmail.com with ESMTPSA id o2sm1847407lfi.50.2020.08.14.05.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 05:22:08 -0700 (PDT) From: =?utf-8?q?Martin_=C3=85gren?= To: "brian m. carlson" Cc: git@vger.kernel.org, Derrick Stolee , Junio C Hamano Subject: [PATCH 4/5] shallow.txt: document SHA-256 shallow format Date: Fri, 14 Aug 2020 14:21:45 +0200 Message-Id: <8e498a3b400a2c8390e78de08b83d41e354e7564.1597406877.git.martin.agren@gmail.com> X-Mailer: git-send-email 2.28.0.277.g9b3c35fffd In-Reply-To: References: <20200813224901.2652387-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Similar to recent commits, document that in SHA-1 repositories, we use SHA-1 for these purposes, and in SHA-256 repositories, we use SHA-256. Signed-off-by: Martin Ågren --- Documentation/technical/shallow.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/technical/shallow.txt b/Documentation/technical/shallow.txt index 01dedfe9ff..f3738baa0f 100644 --- a/Documentation/technical/shallow.txt +++ b/Documentation/technical/shallow.txt @@ -13,7 +13,7 @@ pretend as if they are root commits (e.g. "git log" traversal stops after showing them; "git fsck" does not complain saying the commits listed on their "parent" lines do not exist). -Each line contains exactly one SHA-1. When read, a commit_graft +Each line contains exactly one object name. When read, a commit_graft will be constructed, which has nr_parent < 0 to make it easier to discern from user provided grafts. From patchwork Fri Aug 14 12:21:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11714493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26E15739 for ; Fri, 14 Aug 2020 12:22:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C4E720B1F for ; Fri, 14 Aug 2020 12:22:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AO8c6SQJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727120AbgHNMWR (ORCPT ); Fri, 14 Aug 2020 08:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgHNMWN (ORCPT ); Fri, 14 Aug 2020 08:22:13 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43C0DC061384 for ; Fri, 14 Aug 2020 05:22:13 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id s9so4715679lfs.4 for ; Fri, 14 Aug 2020 05:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZF/3L/cZUEESEYGxaPF6dOQvJ17EYN+1uBmRO7+NdNI=; b=AO8c6SQJYXSxqJmxbvQQhRqJHjg9BAij6BMl9CJ8yr/OBcGkXhQaf9Ez99plPUC0bA Z+KjxNLqGjVJWgErVaKAExhmst6l0BMBeAhLYBksu3iNt6b51SgEBMaQlvvnfPE0Q0Nl JsNPL1OL1UNHLIJmrNU08HT0GOfDzqwiKvnIXfJLIZWow5yTDQNDnWQQDFlB+RRnGb0i joOSbWWD3OyOAxpwtLDepibsfBZAs/pH6fRkjIB4rvxhWmQO8WoGmJwy47a6Wy303a+B CY4MDrqwDPUJVIgOgp2a4mEGd2jzATYmRTSXYhinRikOQJMa/ojX6w6zS9DI/4mBU0T1 y5+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZF/3L/cZUEESEYGxaPF6dOQvJ17EYN+1uBmRO7+NdNI=; b=uFXqSjm0N/vvt1mrMmRViPg4xYzFJvs2vFxNsVU13hnKpHHb+txPkfy6hx2GdgDPAV X2EBwQCX8jnF61edCkwXLvxxQmrj9QS/pcBQRXpaqKeHVQS9uOSLPA5XRTNLIK/NSH6f kefSrvuS1l/o189BhSUNVTUSVT3S7HyGj9pZ0hQVvVmhNy5FWsq+SRbnHjxY6DO8yPH8 bbIFtvQwPCXMJ3FomBp9kEBfLKyn9oDKbbIL7yHponk9JuVOBaRo2CJgXYnnoM/yCLah AtKeIfLXTFBItJ/eEHcPj9FbztJcFDaz+oyDYT6j9UY/PCnus4N69iMgfxIz+H33WbhH A/FQ== X-Gm-Message-State: AOAM531iWpb0bc1Ykz2s2vPGnSd073IHMIP7URF5WLT9cyA09AgjE04D FfoGXQ/CYun7gXUn6xGNY4jV/hj4uUA= X-Google-Smtp-Source: ABdhPJzmmyFncsLJyFmjcnspmFBrlqEGD2VSirW6WEaJyS1zsRwfyxYPljSXh4Nz5N2bwM1Ej5Jj9A== X-Received: by 2002:a05:6512:3af:: with SMTP id v15mr1110129lfp.79.1597407731706; Fri, 14 Aug 2020 05:22:11 -0700 (PDT) Received: from localhost.localdomain (92-33-153-30.customers.ownit.se. [92.33.153.30]) by smtp.gmail.com with ESMTPSA id o2sm1847407lfi.50.2020.08.14.05.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 05:22:11 -0700 (PDT) From: =?utf-8?q?Martin_=C3=85gren?= To: "brian m. carlson" Cc: git@vger.kernel.org, Derrick Stolee , Junio C Hamano Subject: [PATCH 5/5] commit-graph-format.txt: fix "Hash Version" description Date: Fri, 14 Aug 2020 14:21:46 +0200 Message-Id: X-Mailer: git-send-email 2.28.0.277.g9b3c35fffd In-Reply-To: References: <20200813224901.2652387-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We say that value 1 means "SHA-1", but in fact, it means "whatever the_hash_algo is", see commit c166599862 ("commit-graph: convert to using the_hash_algo", 2018-11-14). Signed-off-by: Martin Ågren --- If we want to be more fine-grained in the future, we'll need to say, e.g., "2 means SHA-1, 3 means SHA-256" or, perhaps preferrably, bump the version number. I wonder: Should we instead say "1 means SHA-1, 2 means SHA-256"? It could be implemented as "easily" as "if (value_from_header != value_from_the_hash_algo) die(...);" for now. Might that pay off in the long run? This relates to Stolee's "in a vacuum" comment [1] ... so maybe we're fine. [1] https://lore.kernel.org/git/da077fb0-14bb-b84f-c526-d759ebc9f5eb@gmail.com/ Documentation/technical/commit-graph-format.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/technical/commit-graph-format.txt b/Documentation/technical/commit-graph-format.txt index 440541045d..3535426d32 100644 --- a/Documentation/technical/commit-graph-format.txt +++ b/Documentation/technical/commit-graph-format.txt @@ -42,8 +42,8 @@ HEADER: 1-byte version number: Currently, the only valid version is 1. - 1-byte Hash Version (1 = SHA-1) - We infer the hash length (H) from this value. + 1-byte Hash Version (1 = SHA-1 in SHA-1 repo, SHA-256 in SHA-256 repo) + We infer the hash length (H) from the hash algo derived from this value. 1-byte number (C) of "chunks"