Announcement

Collapse
No announcement yet.

Contribute a wrapper script, When compare two git project, can read both .gitignore.

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

  • Contribute a wrapper script, When compare two git project, can read both .gitignore.

    Ever I hope bc3 have function to support .gitignore, but I find a bc3 3.38 support -filters argument. it can be utilize to add git ignore list to bc3 filters list.

    It not good, and not elegance, but enough. ; )

    #!/bin/sh

    filename=$(realpath -es "[email protected]")
    gitignore=$(echo "$filename" |xargs -d"\n" -n1 sh -c '[ -d "[email protected]" ] && [ -s "[email protected]/.gitignore" ] && echo "[email protected]/.gitignore"' sh)
    [ "$gitignore" ] && git_filter=$(IFS=$'\n' ; cat $gitignore |sort|uniq|sed 's/^/-/'|tr '\n' ';')
    base_filter="-#*#;-*~;-.#*.*;-.git/;-.gitignore"
    filter="$git_filter$base_filter"

    BCompare -filters=$filter "[email protected]"
    saved as a script, named bc3 in your path.
    Last edited by zw963; 18-Sep-2013, 01:48 PM.
Working...
X