File: git_changed_files.sh

package info (click to toggle)
worker 5.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,444 kB
  • sloc: cpp: 133,098; sh: 5,543; yacc: 1,649; makefile: 791; lex: 279; python: 85; xml: 45
file content (19 lines) | stat: -rwxr-xr-x 332 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /bin/bash

if [ "$#" -lt 1 ]; then
    commitcount=1
else
    commitcount=$1
fi

basedir=$(git rev-parse --show-toplevel 2>/dev/null)
if [ $? -ne 0 ]; then
    exit
fi

git log -$commitcount --name-only --pretty=tformat: -- . |\
    sort -u |
    while read f; do
        fullname="$basedir/$f"
        echo "$fullname"
    done