File: commitByDirectory.sh

package info (click to toggle)
pgrouting 4.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,332 kB
  • sloc: cpp: 21,315; sql: 10,419; ansic: 9,795; perl: 1,142; sh: 919; javascript: 314; xml: 182; makefile: 29
file content (21 lines) | stat: -rwxr-xr-x 704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# This file is part of the pgRouting project.
# Copyright (c) 2021-2026 pgRouting developers
# License: GPL-2 See https://github.com/pgRouting/pgrouting/blob/main/LICENSE

DIR=$1
TASK=$2

if [ -z "${DIR}" ] ; then echo "USE: tools/developer/commitByDirectory.sh directory message"; exit 1; fi;
if [ -z "${TASK}" ] ; then echo "USE: tools/developer/commitByDirectory.sh directory message"; exit 1; fi;

for d in "${DIR}"/* ; do
    echo "--- PROCESSING $d ---"
    COMMIT_MSG="[${d}] ${TASK}"
    git add "${d}"
    git diff --name-only --cached
    sleep 3
    git diff --cached --quiet || echo "${COMMIT_MSG}"
    git diff --cached --quiet || git commit --no-status -m "${COMMIT_MSG}"
done