From patchwork Thu Jun 13 22:15:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emily Shaffer X-Patchwork-Id: 10993701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B237C76 for ; Thu, 13 Jun 2019 22:15:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FE2A26224 for ; Thu, 13 Jun 2019 22:15:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DEAC26E97; Thu, 13 Jun 2019 22:15:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3228D26224 for ; Thu, 13 Jun 2019 22:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726665AbfFMWPt (ORCPT ); Thu, 13 Jun 2019 18:15:49 -0400 Received: from mail-qk1-f201.google.com ([209.85.222.201]:37902 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbfFMWPt (ORCPT ); Thu, 13 Jun 2019 18:15:49 -0400 Received: by mail-qk1-f201.google.com with SMTP id n190so360597qkd.5 for ; Thu, 13 Jun 2019 15:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=7hXyskFKznsPKBFriFHPNRxUfRJGgVP4ly6SCWzFU+I=; b=FknqYqOpFw4gt+VbE/lnSbg2i0604I5j9QDc5niMPge5r5Wn9rjGrCjgFaQz9R1Hu+ dCeUgvJFfEOyXQH7TaaH3+WESlw7ctrtnuSyy1tS+YkLAXuXeOTErWVdHpbnzbSYIz6q 0s5NvBQj4CDuOUOHUn/5rrqc8mMrOIYK+fzbIkL/rs96CBDTxNqRP1Y4LNynulOHQrKd +3WqsgXdOnOFS5mu/38X75FIC6Rx75CxX8IVeCHMre7kma6krWwqeys6HFJANfL20GuH UIeLoof0pm80R7XAa2hWtZErN3vDjPZGvQpQJWqmTXh07ppMrqZF2zxprAMqLGqRaoob xJXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=7hXyskFKznsPKBFriFHPNRxUfRJGgVP4ly6SCWzFU+I=; b=Yy7Z0lJYE5EUYEJ2vaFhcnJoABd3fKMGUQxDNnyrmlXWnZqcCvm4cDy6icAVZT0vYR d7w8p1MDWTOq6PLBKwPSidg2eUJlnsXL3gL4c5heWWR6pfD4e1DAvOgUjx4ZKrkvEHOm Deg7w7JeS1mQTZIKTmqGYACOQTJAG9ZWe6J99rH9b/ISjS9lSz9m5xFj9mG1gdOpCNH0 WeRyFjV359l3vgky/WX2WGq0qwx0vC+KO4zr2N6Kq1j3fGPIBfIK2eSImvWR4x7zYG8V oxjY+quHnCSYfvnzhDSE/pLUZapiS9h538dxfyz7JZ9X5KDGmgCm5SWS7Xyxrh05Qgl8 oWDw== X-Gm-Message-State: APjAAAVqECcYLdtU7N52qPhmi5bD2DvLS7v0tB1Mki3Z+1ekxYhMP9Z/ 3WZ3dv4Apnh6aXd7G3yh4kLody4fawgdHmZNu7TXszAQPdv2AkXWbjji3XF8oqfw6WdQ9qlhrIW kkENAidWOQc0lopKtX1ZMyKW/AEO1ijBbB7ro4CB9zMabjEoEIAdfgMfQ+bsttHV6/0VJmWzz9w == X-Google-Smtp-Source: APXvYqwH23gsXSQkcKHTUhcnHxpvjqnYvXNFeqN4Z/tnolmJyhOUG3vW2wRK3FUGCun/pK7edHqQNRVUEqCFJtfh6/E= X-Received: by 2002:a05:6214:248:: with SMTP id k8mr5482766qvt.200.1560464148030; Thu, 13 Jun 2019 15:15:48 -0700 (PDT) Date: Thu, 13 Jun 2019 15:15:41 -0700 Message-Id: <20190613221541.10007-1-emilyshaffer@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog Subject: [RFC PATCH] rev-list: clarify --abbrev and --abbrev-commit usage From: Emily Shaffer To: git@vger.kernel.org Cc: Emily Shaffer Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Indicate that --abbrev only works with --abbrev-commit also specified. It seems that simply running `git rev-list --abbrev=5` doesn't abbreviate commit OIDs. But the combination of `git rev-list --abbrev-commit --abbrev=5` works as expected. Clarify in the documentation by indicating that --abbrev is an optional addition to the --abbrev-commit option. --no-abbrev remains on a separate line as it can still be used to disable OID abbreviation even if --abbrev-commit has been specified. Signed-off-by: Emily Shaffer Change-Id: If9b1198938e1a3515ae6740241f7b791fb7a88bd --- I thought this was odd when I was working on the other rev-list changes - --abbrev doesn't do anything on its own. It looks like it does work by itself in other commands, but apparently not in rev-list. Listed this patch as RFC because maybe instead it's better to fix something so --abbrev can be used alone, or teach --abbrev-commit=. It looks like `git log --abbrev=5` also doesn't work the way one might expect, which makes sense to me, as they use the same internals for option parsing (parse_revisions()). The manpages for log and rev-list both correctly indicate that --abbrev= is an optional addition to --abbrev-commit. `git log -h` is generated by parse-options tooling and doesn't cover --abbrev-commit at all, but `git rev-list` doesn't use an option parser on its own and the usage is hardcoded. - Emily builtin/rev-list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/rev-list.c b/builtin/rev-list.c index 9f31837d30..6ae0087b01 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -49,8 +49,8 @@ static const char rev_list_usage[] = " --objects | --objects-edge\n" " --unpacked\n" " --header | --pretty\n" -" --abbrev= | --no-abbrev\n" -" --abbrev-commit\n" +" --abbrev-commit [--abbrev=]\n" +" --no-abbrev\n" " --left-right\n" " --count\n" " special purpose:\n"