Ticket #172: git-ci

File git-ci, 495 bytes (added by slavazanko, 11 years ago)

helper for indent before git-commit

Line 
1#!/bin/sh
2
3
4getAddedFiles(){
5git-status | \
6    awk '
7BEGIN {
8    start_block=0;
9}
10/Changes to be committed:/{start_block=1; next;}
11/\(use "git/{next;}
12/(Changed but not updated:|Untracked files:)/{start_block=0; next;}
13{
14    if (start_block == 1 && $3 != "" ){print $3;}
15    next;
16}
17'| grep '\.[ch]$'
18}
19
20indentAddedfiles(){
21    indent \
22        --gnu-style \
23        --format-first-column-comments \
24        --indent-level4 \
25        --brace-indent0 \
26        --use-tabs \
27        $@
28}
29
30indentAddedfiles $(getAddedFiles)
31
32git-commit $@