Opened 6 years ago

Closed 4 years ago

#56664 closed enhancement (fixed)

enable diff-highlight in git, with variant

Reported by: iefdev (Eric F) Owned by: ci42
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc:
Port: git

Description

Found a saved link/tweet from last year, that I forgot to ask about, and make this request…

 

Last year with v2.13.3, “diff-highlight” disappeard and now you have to manually run a make in that folder to bring it back.

Wouldn't it be good to bring that back with a variant (&/or make it default)? To activate it, one have to add the functionalty to config as normal/before.

Something like:

  • (a) a/Portfile.orig vs. (b) b/Portfile

    diff --git a/Portfile.orig b/Portfile
    index 44d286a..1b0f030 100644
    a b variant credential_osxkeychain description {Install git credential-osxkeychain u 
    219219    }
    220220}
    221221
     222variant diff-highlight description {Install the diff-highlight utility from contrib} {
     223
     224    post-build {
     225        system -W "${worksrcpath}/contrib/diff-highlight" "make"
     226    }
     227
     228    notes "
     229To add the functionality to config, run:
     230
     231    $ git config --global interactive.diffFilter diff-highlight
     232
     233"
     234
     235}
     236
    222237platform darwin 8 {
    223238    build.args-append   NO_APPLE_COMMON_CRYPTO=1
    224239}
    225240
    226 default_variants    +doc +pcre +credential_osxkeychain
     241default_variants    +doc +pcre +credential_osxkeychain +diff-highlight
    227242
    228243livecheck.type          regexm
    229244livecheck.regex         {<span class="version">.*?(\d+\.\d+\.\d+).*?</span>}

Note: Compared to the “osxkeychain” variant… There's a "make [join ${build.args}]" there. Not sure if that would be necessary? You just run make if you do it manually.

 

Anyway, it would be nice to add it in some way, even if not default, but the default would bring the old behaviour back.

Adding a patch (from above), and an example picture incase anyone wonder what the diff-highlight is.

Attachments (3)

Portfile_diff_highlight.diff (851 bytes) - added by iEFdev 6 years ago.
mp_diff-hl_example.png (24.5 KB) - added by iEFdev 6 years ago.
Portfile_diff_highlight.2.diff (861 bytes) - added by iEFdev 6 years ago.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by iEFdev

Changed 6 years ago by iEFdev

Attachment: mp_diff-hl_example.png added

comment:1 Changed 6 years ago by raimue (Rainer Müller)

Variant names must not contain a minus as that would be ambiguous (it is used to negate variants). Apparently you have not tested this change, as the Portfile fails to parse.

Your notes do not describe what "functionality" they refer to.

Now that you added a post-build to build the script, would it not also required to be copied in the destroot phase?

comment:2 in reply to:  1 Changed 6 years ago by iEFdev

Replying to raimue:

Variant names must not contain a minus as that would be ambiguous (it is used to negate variants). Apparently you have not tested this change, as the Portfile fails to parse.

Sorry, my bad

 

Your notes do not describe what "functionality" they refer to.

Yes, it sounded a bit vague... I changed it to:

--->  Staging git into destroot
--->  Installing git @2.17.1_0+credential_osxkeychain+diff_highlight+doc+pcre+perl5_26
--->  Activating git @2.17.1_0+credential_osxkeychain+diff_highlight+doc+pcre+perl5_26
// … //
--->  Some of the ports you installed have notes:
  git has the following notes:
    To add the use of "diff-highlight" to config, run:
   
        $ git config --global interactive.diffFilter diff-highlight

Better? Perhaps there's another terminlogy to use?

 

Now that you added a post-build to build the script, would it not also required to be copied in the destroot phase?

No, the file/script stays in its contrib folder.

adding a new patch

Changed 6 years ago by iEFdev

comment:3 Changed 6 years ago by mf2k (Frank Schima)

Type: requestenhancement
Version: 2.5.2

Note that a "request" ticket type is only for requesting a new port.

comment:4 in reply to:  3 Changed 6 years ago by iEFdev

Replying to mf2k:

Note that a "request" ticket type is only for requesting a new port.

Ok, thanks! I didn't know that.

comment:5 Changed 5 years ago by iEFdev

Any update on this, if it will be fixed or not?

Had to go and fix it manually again after the last update.

comment:6 Changed 5 years ago by reneeotten (Renee Otten)

it looks like this commit (followed by this one) resolved this ticket, correct?

comment:7 in reply to:  6 Changed 5 years ago by iEFdev

Replying to reneeotten:

it looks like this commit (followed by this one) resolved this ticket, correct?

Yes, it showed up tonight when I updated my ports.

Thanks! :+1:

comment:8 Changed 4 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.