From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 447f667a for ; Sat, 9 Mar 2019 23:38:42 +0000 (UTC) Received: (qmail 19483 invoked by alias); 9 Mar 2019 23:38:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44111 Received: (qmail 9831 invoked by uid 1010); 9 Mar 2019 23:38:25 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f172.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25376. spamassassin: 3.4.2. Clear:RC:0(209.85.166.172):SA:0(-1.9/5.0):. Processed in 2.030027 secs); 09 Mar 2019 23:38:25 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.172 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ljfegZP8sdapj23OG/EJigopMGcb57IFmkev1chHvfo=; b=WO2YMiY4RbVeeck7xD0O98ZWEGfyWAQa2s7xAFVpKhOASl2K1lrQXk8n33pWOeuUD8 Ag9HBsLKlDJXcgn5HT0iBeMn2DkXz1rDdNzNf/TrWlhEKG8/ilEHkrXW6KzscpRvRtgC K0s/FC4/W9P7Ga3CcmzxtXBMTz5l4VsmSn0KbteC4thcT20xYKkU0Sfn/hXbDQ/i0jun TpJh+Q8hO7wrUpoJaWE9ThGu2B5HX8yaHONB/hh9PKujDOklg9m9r33OiKlaNCgdZCDA TTlOshtukLgDTN31cBy20sDZZnBc5ZrPSz9xjJrpFYkXwP7U5nV/b1cMEe8LiFpYPSbp 6PUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ljfegZP8sdapj23OG/EJigopMGcb57IFmkev1chHvfo=; b=bhCs57rF/gat4dNTHn+pdNIH77YIV2XUxVl/kbGtlFyk2lPqS+8s8FTwoPVxjegNk0 102RSgewO5N4cgiWgY6CxXvaFBBXH7WNSLszvFF9m+MUKnaM2vWFcSZK5kCfe0CVgmOG xdKKIvMZHHOTKGWEJ2wFqhQkZWCQ4DBbrbj2qFX/58pOY9EwYyvONYZCMeRuxqZYHZAQ 0Nj8HLmPstTuEv6npqCDBRJKAELVMCZce9y/c5aPGs3QiOQmC/eVEfIMih9mU3i7AJqt 1jLsMZDWenTYJyTCANISv/9riNdPh4DPbjLaddaUa+L1TC5Kk+5ncCE0V4VStllTM9YS ZTeA== X-Gm-Message-State: APjAAAX6/+YRwwfoYjR5I2KJ2+JpzTthx0ehSMKt+zMZpLUzgCsmWpFJ ECEmfoEbr44ps9BG/oVX5ML3jkUt6nm1AA== X-Google-Smtp-Source: APXvYqyydkcg94m0aXkKv+KE8j1xUrHRFMuK+koZjGSCC0X+W3hhu47+4M+i1EZ3UaHZm1YOdJKqOA== X-Received: by 2002:a05:660c:485:: with SMTP id a5mr12527683itk.29.1552174668796; Sat, 09 Mar 2019 15:37:48 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: Bug in git tab completion: If git.showSignature = true is set globally, tab completion of commits is garbled From: dana In-Reply-To: <57caa504-8287-4078-bd34-47ac7426e1db@www.fastmail.com> Date: Sat, 9 Mar 2019 17:37:47 -0600 Cc: zsh-workers@zsh.org, Adrian Vollmer Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190307192305.GA3173@av.sy.gs> <7a2210af-0a67-4289-86c2-388e67eff32e@www.fastmail.com> <85B1B476-6F08-4AB0-8E30-B165A0E98082@dana.is> <57caa504-8287-4078-bd34-47ac7426e1db@www.fastmail.com> To: Daniel Shahaf X-Mailer: Apple Mail (2.3445.100.39) On 9 Mar 2019, at 10:43, Daniel Shahaf wrote: >Huh. Odd, but I think we can live with that: we can just have _git >discard the hardcoded header line that git emits. All we really care >about is that future git versions will continue to emit that line. I >assume they will, for compatibility reasons. In that case, i think it would be something like this? I didn't test = very extensively (not even sure which paths exactly lead to these commands), = but it does seem to work for the scenario at hand (--oneline is hard-coded to not print the hard-coded header) dana diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index e5e4ee768..4eb07e921 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5652,7 +5652,7 @@ __git_describe_branch () { local __c local -a __commits for __c in ${(P)__commits_in}; do - __commits+=3D("${__c}:${$(_call_program describe git log -1 = --oneline $__c)//:/\\:}") + __commits+=3D("${__c}:${$(_call_program describe git rev-list -1 = --oneline $__c)//:/\\:}") done _describe -t $__tag $__desc __commits "$@" else @@ -6493,8 +6493,9 @@ __git_commit_objects () { =20 # Note: the after-the-colon part must be unique across the entire = array; # see workers/34768 - commits=3D(${(f)"$(_call_program commits git --no-pager log -1000 = --all --reflog --format=3D'%h:\[%h\]\ %s\ \(%cr\)')"}) + commits=3D(${(f)"$(_call_program commits git --no-pager rev-list = -1000 --all --reflog --format=3D'%h:\[%h\]\ %s\ \(%cr\)' HEAD)"}) __git_command_successful $pipestatus || return 1 + commits=3D(${commits:#commit [[:xdigit:]](#c40,)}) =20 _describe -Vx -t commits 'commit object name' commits } @@ -6503,7 +6504,7 @@ __git_commit_objects () { __git_recent_commits () { local gitdir expl start declare -a descr tags heads commits argument_array_names commit_opts - local i j k ret + local h i j k ret integer distance_from_head local label local parents @@ -6517,10 +6518,11 @@ __git_recent_commits () { =20 # Careful: most %d will expand to the empty string. Quote properly! # NOTE: we could use %D directly, but it's not available in git 1.9.1 = at least. - commits=3D("${(f)"$(_call_program commits git --no-pager log = ${(q)commit_opts} -20 --format=3D'%h%n%d%n%s\ \(%cr\)%n%p')"}") + commits=3D("${(f)"$(_call_program commits git --no-pager rev-list = ${(q)commit_opts} -20 --format=3D'%h%n%d%n%s\ \(%cr\)%n%p' HEAD)"}") __git_command_successful $pipestatus || return 1 =20 - for i j k parents in "$commits[@]" ; do + # h =3D> hard-coded 'commit abcdef1234567890...' -- just discarded + for h i j k parents in "$commits[@]" ; do # Note: the after-the-colon part must be unique across the entire = array; # see workers/34768 if (( $#commit_opts )); then