summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 514c09f)
raw | patch | inline | side by side (parent: 514c09f)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 12 Jan 2007 20:52:03 +0000 (12:52 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 13 Jan 2007 00:54:38 +0000 (16:54 -0800) |
This updates five commands (merge, pull, rebase, revert and cherry-pick)
so that they can be started from a subdirectory.
This may not actually be what we want to do. These commands are
inherently whole-tree operations, and an inexperienced user may
mistakenly expect a "git pull" from a subdirectory would merge
only the subdirectory the command started from.
Signed-off-by: Junio C Hamano <junkio@cox.net>
so that they can be started from a subdirectory.
This may not actually be what we want to do. These commands are
inherently whole-tree operations, and an inexperienced user may
mistakenly expect a "git pull" from a subdirectory would merge
only the subdirectory the command started from.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-merge.sh | patch | blob | history | |
git-pull.sh | patch | blob | history | |
git-rebase.sh | patch | blob | history | |
git-revert.sh | patch | blob | history |
diff --git a/git-merge.sh b/git-merge.sh
index 3eef048efc7a848145697e205d154c92f8c7ec0f..7de83dc76c442e2187c66d32bc704a063ab83781 100755 (executable)
--- a/git-merge.sh
+++ b/git-merge.sh
USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
+SUBDIRECTORY_OK=Yes
. git-sh-setup
set_reflog_action "merge $*"
require_work_tree
+cd_to_toplevel
test -z "$(git ls-files -u)" ||
- die "You are in a middle of conflicted merge."
+ die "You are in the middle of a conflicted merge."
LF='
'
diff --git a/git-pull.sh b/git-pull.sh
index e9826fc4cec14d82171f495af25324b24fe9f19b..959261757c1fd8df50f7894ba449b76d621f3c45 100755 (executable)
--- a/git-pull.sh
+++ b/git-pull.sh
USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [<fetch-options>] <repo> <head>...'
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
+SUBDIRECTORY_OK=Yes
. git-sh-setup
set_reflog_action "pull $*"
require_work_tree
+cd_to_toplevel
test -z "$(git ls-files -u)" ||
- die "You are in a middle of conflicted merge."
+ die "You are in the middle of a conflicted merge."
strategy_args= no_summary= no_commit= squash=
while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
diff --git a/git-rebase.sh b/git-rebase.sh
index 98f9558145f269e05e121006a5853368f0572abf..c8bd0f99d1306cd311eaf45f73581efc8bb0e512 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
/ --> /
D---E---F---G master D---E---F---G master
'
+
+SUBDIRECTORY_OK=Yes
. git-sh-setup
set_reflog_action rebase
require_work_tree
+cd_to_toplevel
RESOLVEMSG="
When you have resolved this problem run \"git rebase --continue\".
diff --git a/git-revert.sh b/git-revert.sh
index fcca3ebb90e7b72d5b494e907f1c12060a04287d..224e6540ca073da804332799660a8cdeacdfdaf7 100755 (executable)
--- a/git-revert.sh
+++ b/git-revert.sh
echo >&2 "What are you talking about?"
exit 1 ;;
esac
+
+SUBDIRECTORY_OK=Yes ;# we will cd up
. git-sh-setup
require_work_tree
+cd_to_toplevel
no_commit=
while case "$#" in 0) break ;; esac