├── push.sh └── scripts ├── visual-diffs_on_gerber-files ├── pics │ └── gerber-visual-diff.png ├── gitconfig ├── vis_diff.sh └── README.md └── footprint_manipulation ├── mass_hide_FP-ref-field.sh ├── mass_hide_FP-value-field.sh ├── mass_unhide_FP-ref-field.sh └── mass_unhide_FP-value-field.sh /push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git push --all gso && git push --all github 3 | git push --tags gso && git push --tags github 4 | 5 | -------------------------------------------------------------------------------- /scripts/visual-diffs_on_gerber-files/pics/gerber-visual-diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madworm/KiCad-Stuff/HEAD/scripts/visual-diffs_on_gerber-files/pics/gerber-visual-diff.png -------------------------------------------------------------------------------- /scripts/footprint_manipulation/mass_hide_FP-ref-field.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for FILE in `ls *.kicad_mod`; do TMP=`mktemp` && cat $FILE | sed 's/\(.*(fp_text\ reference.*)\)/\1 hide/' > $TMP && mv $TMP $FILE; done 4 | 5 | -------------------------------------------------------------------------------- /scripts/footprint_manipulation/mass_hide_FP-value-field.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for FILE in `ls *.kicad_mod`; do TMP=`mktemp` && cat $FILE | sed 's/\(.*(fp_text\ value.*)\)/\1 hide/' > $TMP && mv $TMP $FILE; done 4 | 5 | -------------------------------------------------------------------------------- /scripts/footprint_manipulation/mass_unhide_FP-ref-field.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for FILE in `ls *.kicad_mod`; do TMP=`mktemp` && cat $FILE | sed 's/\(.*(fp_text\ reference.*)\)\ hide/\1/' > $TMP && mv $TMP $FILE; done 4 | 5 | -------------------------------------------------------------------------------- /scripts/footprint_manipulation/mass_unhide_FP-value-field.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for FILE in `ls *.kicad_mod`; do TMP=`mktemp` && cat $FILE | sed 's/\(.*(fp_text\ value.*)\)\ hide/\1/' > $TMP && mv $TMP $FILE; done 4 | 5 | -------------------------------------------------------------------------------- /scripts/visual-diffs_on_gerber-files/gitconfig: -------------------------------------------------------------------------------- 1 | [color] 2 | # diff = true 3 | # grep = true 4 | # branch = true 5 | # interactive = true 6 | # pager = true 7 | # showbranch = true 8 | # status = true 9 | ui = auto 10 | 11 | [color "diff"] 12 | meta = blue 13 | frag = magenta 14 | old = red reverse 15 | new = green reverse 16 | whitespace = blue reverse 17 | 18 | [color "status"] 19 | added = green 20 | changed = red 21 | untracked = red 22 | 23 | [alias] 24 | wdiff = diff --color-words 25 | 26 | [user] 27 | name = Your Name 28 | email = me@somewhere.com 29 | 30 | [core] 31 | whitespace = indent-with-non-tab 32 | 33 | [difftool] 34 | prompt = false 35 | 36 | [difftool "visdiff"] 37 | cmd = /usr/local/bin/vis_diff.sh $LOCAL $REMOTE 38 | -------------------------------------------------------------------------------- /scripts/visual-diffs_on_gerber-files/vis_diff.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | shopt -s nocasematch 4 | 5 | # 6 | # Check if all tools are available 7 | # 8 | if [[ ! -e `which gerbv` ]] 9 | then 10 | echo -e "\nPlease install 'gerbv'\n" 11 | EXIT=1 12 | fi 13 | 14 | if [[ $# -ne 2 ]] 15 | then 16 | echo -e "\nUsage: $0 FILE1 FILE2" 17 | EXIT=1 18 | fi 19 | 20 | if [[ $EXIT -eq 1 ]] 21 | then 22 | echo -e "\nBYE!\n" 23 | exit 24 | fi 25 | 26 | # 27 | # do a simple check for image-(like) file formats 28 | # 29 | if [[ $1 =~ ^.*\.(g[a-z]{2}|drl|oln|gm1)$ && ! $1 =~ ^.*.gvp$ ]] 30 | then 31 | TMPFILE0=`mktemp --suffix=_git` 32 | TMPFILE1=`mktemp --suffix=_git` 33 | TMPFILE2=`mktemp --suffix=_git` 34 | 35 | cp $1 $TMPFILE1 36 | cp $2 $TMPFILE2 37 | 38 | GERBV_TEMPLATE="(gerbv-file-version! \"2.0A\")\n 39 | (define-layer! 1 (cons 'filename \"${TMPFILE1}\")(cons 'visible #t)(cons 'color #(65535 0 3050)))\n 40 | (define-layer! 0 (cons 'filename \"${TMPFILE2}\")(cons 'visible #t)(cons 'color #(8188 65535 0)))\n 41 | (set-render-type! 1)" 42 | 43 | echo -e $GERBV_TEMPLATE > $TMPFILE0 44 | gerbv -p $TMPFILE0 45 | 46 | rm $TMPFILE0 47 | rm $TMPFILE1 48 | rm $TMPFILE2 49 | else 50 | # unsupported file format 51 | diff -u $1 $2 |less 52 | fi 53 | -------------------------------------------------------------------------------- /scripts/visual-diffs_on_gerber-files/README.md: -------------------------------------------------------------------------------- 1 | 2 | What is this? 3 | ============= 4 | 5 | This is a _very basic_ way of getting visual diffs for gerber files using git. 6 | 7 | [![visual-diff_on_gerber-files](/scripts/visual-diffs_on_gerber-files/pics/gerber-visual-diff.png)](/scripts/visual-diffs_on_gerber-files/pics/gerber-visual-diff.png) 8 | 9 | This script uses 'gerbv' to show differences in gerber files by XOR-ing two revisions supplied by git. 10 | 11 | 12 | Requirements: 13 | ============= 14 | 15 | * tools: gerbv + diff 16 | * KiCad: don't forget to create gerber files for each commit 17 | 18 | 19 | Setup: 20 | ====== 21 | 22 | 1) Adapt your personal '.gitconfig' to include the [difftool] sections. 23 | 24 | 2) Adjust as necessary! 25 | 26 | 3) Copy the script to a convenient place (/usr/local/bin/) and make it executable. 27 | 28 | 4) Easily integrates with the 'qgit' GUI as 'external-diff' (Ctrl+D). 29 | 30 | Configure 'qgit' to run "xterm -e vis_diff.sh" as its 'External diff tool'. 31 | 32 | 33 | Invocation from git: 34 | ==================== 35 | 36 | 1) To see the changes in the current working tree 37 | 38 | git difftool -t visdiff 39 | 40 | 2) Compare any two commits 41 | 42 | git difftool -t visdiff commit-ID-1 commit-ID-2 43 | 44 | 45 | --------------------------------------------------------------------------------