Revision 53726a00

b/devel/review
196 196
  GIT_EDITOR="$me --commit-editor \"\$@\"" git commit -c "$rev" -s
197 197
}
198 198

  
199
main() {
200
  local range="$1" target_branch="$2"
199
usage() {
200
  echo "Usage: $me_plain [from..to] <target-branch>" >&2
201
  echo "  If not passed from..to defaults to target-branch..HEAD" >&2
202
  exit 1
203
}
201 204

  
202
  if [[ -z "$target_branch" || "$range" != *..* ]]
203
  then
204
    echo "Usage: $me_plain <from..to> <target-branch>" >&2
205
    exit 1
206
  fi
205
main() {
206
  local range target_branch
207

  
208
  case "$#" in
209
  1)
210
    target_branch="$1"
211
    range="$target_branch..$(git rev-parse HEAD)"
212
  ;;
213
  2)
214
    range="$1"
215
    target_branch="$2"
216
    if [[ "$range" != *..* ]]; then
217
      usage
218
    fi
219
  ;;
220
  *)
221
    usage
222
  ;;
223
  esac
207 224

  
208 225
  git checkout "$target_branch"
209 226
  local old_head=$(git rev-parse HEAD)

Also available in: Unified diff