• R/O
  • HTTP
  • SSH
  • HTTPS

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Mercurial Queues Emulation for Git


File Info

修訂. 1a53f0d998b3fb0ed2b9ba877996ad57a22b9783
大小 4,870 bytes
時間 2022-03-31 22:05:16
作者 Keith Marshall
Log Message

Promote git-mq-1.0-rc-3 to final release status,

* configure.ac (AC_INIT): Set version number to 1.0
* All files (v1.0-final): Tag assigned; excepting copyright
assignment corrections, none are changed from v1.0-rc-3.

Content

# git-qapplied.shar
# ------------------------------------------------------------------------------
#
# Shell archive to deliver the implementations for the "git qapplied", and
# the "git qunapplied" commands.
#
# ------------------------------------------------------------------------------
#
# $Id$
#
# Written by Keith Marshall <keith@users.osdn.me>
# Copyright (C) 2018-2020, Keith Marshall
#
#
# This file is part of the Git-MQ program suite.
#
# The Git-MQ program suite is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public Licence
# as published by the Free Software Foundation, either version 3 of
# the Licence, or (at your option) any later version.
#
# The Git-MQ program suite is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public Licence for more details.
#
# You should have received a copy of the GNU General Public Licence
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
# ------------------------------------------------------------------------------
#
cat <<ETX
#!/bin/sh
# ------------------------------------------------------------------------------
#
# git-$1.sh: Implement the Git-MQ "git $1" extension command.
#
ETX
cat <<\ETX
# This is derived from the git-qapplied.shar source, which delivers both the
# "git qapplied" and "git qunapplied" command implementations; these list the
# entries in the patch series, up to and including the topmost applied patch,
# or following the topmost applied patch, respectively.
#
# $Id$
#
# ------------------------------------------------------------------------------
#
ETX
cat <<ETX
# I'd have liked to call this a "SYNOPSIS", (which is what it is), but git's
# git-sh-setup script requires the much less appropriate name "OPTIONS_SPEC",
# (which describes only a small subset of its actual content).
#
OPTION_VERBOSE_DEFINED=true OPTIONS_SPEC="\\
git $1 [-v | --verbose] [-s | --summary] [-1 | --`
case $1 in qapplied) echo last ;; qunapplied) echo first ;; esac`]

List entries `case $1 in
qapplied) echo 'up to and including' ;;
qunapplied) echo 'which follow' ;; esac` the topmost applied patch,
in the patch queue series file.
--
1,`case $1 in
qapplied)   echo 'last!  show only the predecessor of the current patch' ;;
qunapplied) echo 'first! show only the first unapplied patch' ;; esac`
s,summary!   include summary lines from patch headers
v,verbose!   show patch sequence numbers and status flags"
ETX

# Incorporate the universal set-up code, which is common to all of the
# Git-MQ command implementations.
#
. ./git-mq-setup.shar

cat <<\ETX
# Parse any command line options, which the user may have specified;
# the git_mq_getopt function will implicitly handle the default global
# options, but we must explicitly handle command specific effects.
#
while git_mq_getopt "$@"
do case $1 in
     -v) mq_output='printf "%*d %s %s\n", fw, idx, state[$1],' ;;
     -s) mq_qseries_append_summary=1 ;;
     -1) mq_qseries_first_last=true ;;
   esac; shift
done

# Set up the command output style; this is essentially the default
# "git qseries" output style, but it is applicable to a restricted
# range of entries within the series file; this range may also be
# subject to further restriction, depending on whether or not the
# "-1" (a.k.a. "--first", or "--last") option has been specified.
#
${mq_qseries_first_last-false} && { mq_qseries_report_setup='
ETX
# Additionally, the applicable ranges are different for each of
# the "git qapplied" command implementation...
#
case $1 in qapplied) cat <<\ETX
      if( prev < 0 )
      { print (applied < 0) ? "No patches have been applied."\
	  : "Only one patch has been applied.";
	idx0 = entries;
      }
      else { idx0 = prev; entries = prev + 1; }'
   } || { mq_qseries_report_setup='
      idx0 = 0; entries = applied + 1;'

test "${mq_output+set}" = set || mq_qseries_state_selector="A"
ETX
# ...and the "git qunapplied" command implementation.
#
;; qunapplied) cat <<\ETX
      if( entries > (idx0 = applied + 1) ) entries = idx0 + 1;
      else print "All patches have been applied.";'
   } || { mq_qseries_report_setup='
      idx0 = applied + 1;'

test "${mq_output+set}" = set || mq_qseries_state_selector="U"
ETX
esac
cat <<\ETX
   }

# Hand off the listing task to the generalized "git qseries" output
# module; this serves as a common back-end handler for all commands
# which are related to "git qseries", (which includes "git qapplied"
# and "git qunapplied"); it also specifies the default style for the
# output from these commands.
#
git_mq_enable_colour_pager mq_require mq-series-list
#
# ------------------------------------------------------------------------------
# $RCSfile$: end of file
ETX