mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
automerge: add option to work in specific directory
* admin/automerge (usage): Mention -d. (dir): New variable. (-d): New option. (main): If requested, cd to specified directory.
This commit is contained in:
parent
aac3ba4d43
commit
113963a89d
1 changed files with 23 additions and 9 deletions
|
|
@ -28,6 +28,11 @@
|
|||
## Intended usage:
|
||||
## Have a dedicated git directory just for this.
|
||||
## Have a cron job that calls this script with -r -p.
|
||||
##
|
||||
## Modifying a running shell script can have unpredictable results,
|
||||
## so the paranoid will first make a copy of this script, and then run
|
||||
## it with the -d option to point to the repository directory, in case
|
||||
## a pull updates this script while it is working.
|
||||
|
||||
die () # write error to stderr and exit
|
||||
{
|
||||
|
|
@ -40,20 +45,14 @@ PD=${0%/*}
|
|||
|
||||
[ "$PD" = "$0" ] && PD=. # if PATH includes PWD
|
||||
|
||||
## This should be the admin directory.
|
||||
cd $PD
|
||||
cd ../
|
||||
[ -d admin ] || die "Could not locate admin directory"
|
||||
|
||||
[ -e .git ] || die "No .git"
|
||||
|
||||
usage ()
|
||||
{
|
||||
cat 1>&2 <<EOF
|
||||
Usage: ${PN} [-b] [-e emacs] [-n nmin] [-p] [-r] [-t] [-- make-flags]
|
||||
Usage: ${PN} [-b] [-d dir] [-e emacs] [-n nmin] [-p] [-r] [-t] [-- mflags]
|
||||
Merge the Emacs release branch to master.
|
||||
Passes any non-option args to make (eg -- -j2).
|
||||
Options:
|
||||
-d: directory to work in (default is parent directory of this script)
|
||||
-e: Emacs executable to use for the initial merge (default $emacs)
|
||||
-n: minimum number of commits to try merging (default $nmin)
|
||||
-b: try to build after merging
|
||||
|
|
@ -74,13 +73,16 @@ test=
|
|||
push=
|
||||
quiet=
|
||||
reset=
|
||||
dir=
|
||||
|
||||
while getopts ":hbe:n:pqrt" option ; do
|
||||
while getopts ":hbd:e:n:pqrt" option ; do
|
||||
case $option in
|
||||
(h) usage ;;
|
||||
|
||||
(b) build=1 ;;
|
||||
|
||||
(d) dir=$OPTARG ;;
|
||||
|
||||
(e) emacs=$OPTARG ;;
|
||||
|
||||
(n) nmin=$OPTARG ;;
|
||||
|
|
@ -104,6 +106,18 @@ shift $(( --OPTIND ))
|
|||
OPTIND=1
|
||||
|
||||
|
||||
if [ "$dir" ]; then
|
||||
cd "$dir" || die
|
||||
else
|
||||
cd $PD # this should be the admin directory
|
||||
cd ../
|
||||
fi
|
||||
|
||||
[ -d admin ] || die "Could not locate admin directory"
|
||||
|
||||
[ -e .git ] || die "No .git"
|
||||
|
||||
|
||||
## Does not work 100% because a lot of Emacs batch output comes on
|
||||
## stderr (?).
|
||||
[ "$quiet" ] && exec 1> /dev/null
|
||||
|
|
|
|||
Loading…
Reference in a new issue