Announcement

Collapse
No announcement yet.

Align With enhancement idea

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Align With enhancement idea

    Just rediscovered tonight that I can use Align With to compare folders with non-matching names. I'd completely forgotten that exists. Nice that I can assign a keybinding too!

    Anyway, here's the idea for enhancement: regular expression archive/folder name matching / regular expression partial archive/folder name ignoring.

    What I'd like to be able to do is have Cirrus look at two folders, and see that m2t-jet-editor-incubation-I200801222240.zip should automatically align with m2t-jet-editor-incubation-I200802052310.zip, without my having to manually align each and every zip in the folder.

    Here's a screenshot showing two build folders.

    http://imagebin.ca/view/7bDWtt6Z.html

    The top one, with all the orphans, shows the default view before alignment. The bottom one shows the zips when aligned. Would it be possible to tell Cirrus that "/[IMNRS]\d{12}/" is a buildID, and to ignore that when looking at two archives or folders, in order to automatically align the old and new zips in these folders?

    Cheers,

    Nick Boldt

  • #2
    The alignment overrides are configured in the "Session Settings" dialog on the "Misc" tab. You can create new overrides there instead of using "Align With", in which case you'll get a dialog to set it up. Both "Align left file" and "with right file" edits must match the full name. If "Regular Expression" is checked then the left is a regular expression and the right is a RE substitution template. If "Regular Expression" isn't checked they can both be DOS masks and Cirrus will translate them appropriately (so *.txt and *.bak are valid non-RE values).
    Zoë P Scooter Software

    Comment


    • #3
      That's cool -- didn't know about that option.

      Some questions:

      1. If I want to align the files as posted in the screenshot above (http://imagebin.ca/view/7bDWtt6Z.html), what patterns would I use?

      I've tried these patterns in both the left & right fields with the regular expression box checked:

      .+[IMRNS]\d+.zip.*
      .+[IMRNS]\d+\.zip.*
      [IMRNS]\d+
      ([IMRNS]\d+)
      .+[IMRNS][0-9]+.zip.*
      .+[IMRNS][0-9]+\.zip.*
      [IMRNS][0-9]+
      m2t-jet-.*zip

      Nothing works. What style of regex is used here, if not perl-compatible ones? Do you specify the whole filename, or just the part to match & ignore? Are quantity modifiers (+ and *) not supported? Or is is more like wildcards, eg., foo*.zip ?

      I tried these, but nothing works either:

      m2t-jet-*.zip
      m2t-jet*zip

      2. Could the dialog let me browse for files/folders in the current session, rather than having to type them in by hand? Once input, if I click the box for regular expression, I could then edit the filename to be a pattern instead of a specific file.

      Comment


      • #4
        The "Align With" masks work by taking an input filename that matches the first mask and using the second mask to generate a new filename. The result is always a specific filename that it tries ti find on the other side, so you can't use wildcards as an "ignore this part for the alignment".

        In the RE case the first edit is a regular expression ( (.*)\.txt ) and the second is a substitution mask ( $1.jpg ) ($ might be \, I can never remember).

        In the non-RE case they both use DOS * and ? wildcards, but it just translates * and ? on input into (.*) and (.) and on output into $1, $2, etc, depending on they're position.

        In both cases the masks have to match the entire filename. So, for your files, you'd need to use:

        *I200801222240* -> *I200802052310*

        or

        (.*)I200801222240(.*) -> $1I200802052310$2
        Zoë P Scooter Software

        Comment


        • #5
          So, there's no way to make the patterns generic on both sides? In other words, I can't match ([IMNRS]\d{12}) in filenames on both sides, and have alignment regardless of the folder I'm looking at?

          From your example, it looks like I can be generic on one side, but not the other. So:

          (.+)-([IMNRS]\d+)(\..+)=${1}-I200802052310${3}

          works, but

          (.+)-([IMNRS]\d+)(\..+)=${1}-${2}${3}

          does not.

          Is there no way to set an alignment-by-filename-substring-or-regex-excusion? If not, could there be? It would be cool to be able to set such a filter once and store it for many folder compares, rather than having to set it up each time I change directories.

          Comment


          • #6
            Originally posted by nickboldt View Post
            So, there's no way to make the patterns generic on both sides? In other words, I can't match ([IMNRS]\d{12}) in filenames on both sides, and have alignment regardless of the folder I'm looking at?
            That's correct.

            The "align with" feature works by transforming one filename into another (eg, replace "Apple" in filename A with "Banana" in filename B). Since the terms have to match the whole filename I can see where the confusion would come from.

            It sounds like you're instead expecting it to work like the text compare's "Unimportant text" feature, where it strips out characters before trying to align anything. We can consider that as a future enhancement, but it isn't how the current feature works.
            Zoë P Scooter Software

            Comment


            • #7
              Originally posted by Craig View Post
              It sounds like you're instead expecting it to work like the text compare's "Unimportant text" feature, where it strips out characters before trying to align anything. We can consider that as a future enhancement, but it isn't how the current feature works.
              Yes. that's what I was thinking... which is why this post was an "enhancement idea," rather than a blocking defect / required feature.

              Comment


              • #8
                Thanks for taking the time to make that feature clear, nick

                I've added it to our wishlist.
                Aaron P Scooter Software

                Comment

                Working...
                X