From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=1.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,LIST_MIRROR_RECEIVED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 1481A1F852 for ; Wed, 2 Feb 2022 21:32:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347626AbiBBVc4 (ORCPT ); Wed, 2 Feb 2022 16:32:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347616AbiBBVct (ORCPT ); Wed, 2 Feb 2022 16:32:49 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED98C061741 for ; Wed, 2 Feb 2022 13:32:49 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id a8so431418pfa.6 for ; Wed, 02 Feb 2022 13:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:references:date:message-id:user-agent :mime-version; bh=TAQjDSexxlY4UQM/1KFsnj6Ex1U3LfDI6THsLB/2F5Q=; b=WSj72I5pBtopSS45JYRjrkcQFy0ZwLXCEXNl8qZrA2wtuu/1p2FNUd8/n+BeC2fQYv PiTPEWh6o6MWcYMq4pZ4HkjFNS5WSIOwXXlftA2p0cYpcCZ0jIdyk7kupcmdhzEwEYSw wrokqE2Z7+zdAGvQNr3ZLQduoYOKShAeiqVORxyM1FLULq44RdW2VbEXViqy2PBDjFhO Bu3rFdCDZhwvXX3ry8Jx0jodshYZJHsX9g3uOdIohAAZCdEtxLxXjJ7PdYa7ZDcUoTbv VwGot+GYMdKuOfK5Uw4S3nlxysaobC5Y4ODh/f014uQ0LM+lXcsOyV8ljLGeSy2vSYkV qMCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:references:date :message-id:user-agent:mime-version; bh=TAQjDSexxlY4UQM/1KFsnj6Ex1U3LfDI6THsLB/2F5Q=; b=B//jNXMNjBl+RD8TXk1LpfclMzleAO182Rjgl4wSwZkhIoO83wDHRiZjufghLj+fdz vmXx3H81cAQS9PZK2ba40RGoD5Bdt8FoPA6HXd+QEODKubhq1OGKSyp4mHYukH2Z9vSY DQgPDAVinDcDfHMZvDht0Spw28l9eljcS4WKgUyzZGkCR4Zf4lcl/Y0v0ox7owuSbdt+ 1cewtaUdCZIJ0UiHO04Pyd+1ZGnGeZFG5IjqbliSUlNpXpgIxaHylp44jo9eUxYGIDgz UxBIrFaEvrDaRwScNM0QR3NwdH6ZIr7jk0L8dBbjMKdxQXSmv7nk1WXPgcmDtc2fyaSH 5lnA== X-Gm-Message-State: AOAM530paviTWaZ4Es7CBkZRAc2g5C1LyRbK8AydOy7p4kKACYMRhV1r +iiTZqX3sbkguaxMlHIK5a4= X-Google-Smtp-Source: ABdhPJxzSRUg+MKZ0wDR9zrxy8FB+kPLghrgXoWTDmctEVWYnHxGw5qpbp1Mim4Z7sTxSA6UuZjzbg== X-Received: by 2002:a62:e116:: with SMTP id q22mr31305125pfh.48.1643837568558; Wed, 02 Feb 2022 13:32:48 -0800 (PST) Received: from localhost ([2620:15c:289:200:da7f:76ba:d0d5:da44]) by smtp.gmail.com with ESMTPSA id lr8sm8035906pjb.11.2022.02.02.13.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 13:32:48 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: "Elijah Newren via GitGitGadget" Cc: git@vger.kernel.org, Christian Couder , Taylor Blau , Johannes Altmanninger , Ramsay Jones , Johannes Schindelin , Christian Couder , =?utf-8?Q?Ren=C3=A9?= Scharfe , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Elijah Newren , Johannes Sixt Subject: Re: [PATCH v2 11/13] merge-tree: provide easy access to `ls-files -u` style info References: Date: Wed, 02 Feb 2022 13:32:47 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "Elijah Newren via GitGitGadget" writes: > @@ -450,7 +451,11 @@ static int real_merge(struct merge_tree_options *o, > merge_get_conflicted_files(&result, &conflicted_files); > for (i = 0; i < conflicted_files.nr; i++) { > const char *name = conflicted_files.items[i].string; > - if (last && !strcmp(last, name)) > + struct stage_info *c = conflicted_files.items[i].util; > + if (!o->exclude_modes_oids_stages) > + printf("%06o %s %d\t", > + c->mode, oid_to_hex(&c->oid), c->stage); > + else if (last && !strcmp(last, name)) > continue; > write_name_quoted_relative( > name, prefix, stdout, line_termination); OK. The addition (and disabling of the deduping) is quite trivial. We do not even have to worry about line termination since the extra pieces of info are prepended to the pathname. Nice. > @@ -485,6 +490,10 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix) > N_("do a trivial merge only"), 't'), > OPT_BOOL(0, "messages", &o.show_messages, > N_("also show informational/conflict messages")), > + OPT_BOOL_F('l', "exclude-modes-oids-stages", > + &o.exclude_modes_oids_stages, > + N_("list conflicted files without modes/oids/stages"), > + PARSE_OPT_NONEG), Why does "-l" give shorter output than without it? "-l" strongly hints a longer output than without, at least to me. Just wondering if this will not become a source of confusion to future scripting users. > OPT_END() > }; >