zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: Marc Finet <m.dreadlock@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 6/9] vcs_info quilt: fix unapplied detection on sub-directory
Date: Thu, 16 Oct 2014 10:17:56 +0200	[thread overview]
Message-ID: <87lhogctsb.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <20141016065926.3a4d503b@mlap.lactee> (Marc Finet's message of "Thu, 16 Oct 2014 06:59:26 +0200")

Marc Finet wrote:
> On Thu, Oct 09, 2014 at 06:03:44PM +0200, Frank Terbeck wrote:
[...]
>> I am unsure about what's going on precisely. Could you do this:
>> 
>>     functions -t vcs_info
>> 
>> And retry your test cases? That will produce long traces of what's going
>> on, and might give ideas as to what's amiss.
> You'll find the trace attached. By the way, how do you deactivate
> tracing ? functions -T vcs_info removes a lot of traces (the VCS_INFO*) but
> keeps traces from vcs_info().

Thanks. I'll take a look as soon as I can.

To disable tracing you'd do this:

    functions +t vcs_info

-T is a slightly different form of tracing. It's disabled via +T.

>> I think $QUILT_PATCHES needs to be set to the correct directory
>> including "patches/". Without, it only works, because the directory is
>> searched recursively.
>> 
>> I don't know why the patches are reported as applied and unapplied off
>> hand. :-/
>> 
>> The applied patches are read from .pc/applied-patches, the list of
>> unapplied patches is retrieved by calling "quilt unapplied".
> This is where the problem occurs, applied uses relative path, while
> unapplied lists absolute path, because QUILT_PATCHES is set to an
> absolute path. e.g.
>     ~/src/from-debian/gmrun-0.9.2# QUILT_PATCHES=$(pwd)/debian/patches quilt applied
>     /home/marc/src/from-debian/gmrun-0.9.2/debian/patches/10-escaping.patch
>     ...
>     /home/marc/src/from-debian/gmrun-0.9.2/debian/patches/80-selectoption.pat
>     ~/src/from-debian/gmrun-0.9.2# quilt applied
>     debian/patches/10-escaping.patch
>     debian/patches/20-includes.patch
>     debian/patches/30-fix-gcc-4.3-build.patch
>     debian/patches/40-history_string.patch
>     debian/patches/50-empty-history.patch
>     debian/patches/60-fix_gtkcompletionline.patch
>
> So applied and unapplied lists are considered differents. The
> .pc/applied-patches file contains only relative paths.

I see. That could be fixed, I guess. Either by making the unapplied list
absolute, or by trimming off the "repository's" root-directory from the
absolute paths before comparing.

>> > So I do not understand the role of quilt-patch-dir as for me it takes
>> > the role of QUILT_PATCHES except the missing '/patches'. Moreover changing
>> > to sub-directory in cases 1, 3 and 5 makes applied patch detection failing
>> > because:
>> 
>> The ‘quilt-patch-dir’ style *sets* QUILT_PATCHES if set. The system
>> also sets QUILT_PATCHES to an absolute path-name, which should make it
>> work in subdirectories as well.
> I do not see where the QUILT_PATCHES variable is set (I mean exported to
> the shell for further quilt commands using this 'detected' value). Maybe
> your hook sets it according to the documentation: "Note: you can use
> vcs_info to keep the value of $QUILT_PATCHES correct all the time via the
> post-quilt hook"

Quilt is only called directly once in vcs_info's quilt code, if I'm not
mistaken. And that's here:

[...]
zstyle -s "${context}" quiltcommand quiltcommand || quiltcommand='quilt'
unapplied=( ${(f)"$(QUILT_PATCHES=$patches $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} )
[...]

I don't have any hooks for quilt behaviour set anymore. But given, that
the hook is called like this:

VCS_INFO_hook 'post-quilt' ${mode} ${patches} ${pc:-\\-nopc-}

You could likely set such a hook like this:

function +vi-quilt-patches() {
    if [[ -n $2 ]]; then
        typeset -gx "QUILT_PATCHES=$2"
    fi
}

zstyle ':vcs_info:*+post-quilt:*:*' hooks quilt-patches

To have $QUILT_PATCHES match vcs_info's idea of the patch directory.


Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


  reply	other threads:[~2014-10-16  8:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 21:30 Misc patches for git completion and vcs_info Marc Finet
2014-09-12 21:30 ` [PATCH 1/9] vcs_info examples: fix typo Marc Finet
2014-09-14  9:33   ` Frank Terbeck
2014-09-12 21:30 ` [PATCH 2/9] completion git: support aliases when \n exist Marc Finet
2014-09-12 21:30 ` [PATCH 3/9] vcs_info git: detect revert or cherry-pick with multiple commits Marc Finet
2014-09-14  9:36   ` Frank Terbeck
2014-09-15  6:22     ` Phil Pennock
2014-09-12 21:30 ` [PATCH 4/9] vcs_info git: set rrn before using it Marc Finet
2014-09-14  9:33   ` Frank Terbeck
2014-09-16 20:07     ` Marc Finet
2014-09-16 20:41       ` Frank Terbeck
2014-09-16 20:57         ` Marc Finet
2014-09-16 21:23           ` Frank Terbeck
2014-09-12 21:30 ` [PATCH 5/9] vcs_info quilt: fix standalone detection Marc Finet
2014-09-14  9:42   ` Frank Terbeck
2014-09-16 20:19     ` Marc Finet
2014-09-12 21:30 ` [PATCH 6/9] vcs_info quilt: fix unapplied detection on sub-directory Marc Finet
2014-09-14  9:47   ` Frank Terbeck
2014-09-16 20:25     ` Marc Finet
2014-10-08 22:36     ` Marc Finet
2014-10-09 16:03       ` Frank Terbeck
2014-10-16  4:59         ` Marc Finet
2014-10-16  8:17           ` Frank Terbeck [this message]
2014-11-08 10:46             ` Marc Finet
2014-11-11 10:07             ` Marc Finet
2015-01-02 11:03               ` Frank Terbeck
2014-09-12 21:30 ` [PATCH 7/9] vcs_info git: fix applied-string name Marc Finet
2014-09-14  9:49   ` Frank Terbeck
2014-09-12 21:30 ` [PATCH 8/9] vcs_info git: consider patches for rebase Marc Finet
2014-09-14 10:08   ` Frank Terbeck
2014-09-14 10:13     ` Frank Terbeck
2014-09-16 20:07       ` Marc Finet
2014-09-12 21:30 ` [PATCH 9/9] completion git: fix send-email --confirm values Marc Finet
2014-09-14 10:11   ` Frank Terbeck
2014-09-12 23:50 ` Misc patches for git completion and vcs_info Bart Schaefer
2014-09-13  7:35   ` Marc Finet
2014-09-13 12:23 ` Frank Terbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhogctsb.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=m.dreadlock@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).