diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-03-29 17:39:15 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-02 13:57:00 +0900 |
commit | c45f0f525de4701b8ff031d5c2c58c0fa819038e (patch) | |
tree | 1b3d321b6c3e269162c36e7463c0ed6e873fa7ca /config.h | |
parent | switch: no worktree status unless real branch switch happens (diff) | |
download | tgif-c45f0f525de4701b8ff031d5c2c58c0fa819038e.tar.xz |
switch: reject if some operation is in progress
Unless you know what you're doing, switching to another branch to do
something then switching back could be confusing. Worse, you may even
forget that you're in the middle of something. By the time you realize,
you may have done a ton of work and it gets harder to go back.
A new option --ignore-in-progress was considered but dropped because it
was not exactly clear what should happen. Sometimes you can switch away
and get back safely and resume the operation. Sometimes not. And the
git-checkout behavior is automatically clear merge/revert/cherry-pick,
which makes it a bit even more confusing [1].
We may revisit and add this option in the future. But for now play it
safe and not allow it (you can't even skip this check with --force). The
user is suggested to cancel the operation by themselves (and hopefully
they do consider the consequences, not blindly type the command), or to
create a separate worktree instead of switching. The third option is
the good old "git checkout", but it's not mentioned.
[1] CACsJy8Axa5WsLSjiscjnxVK6jQHkfs-gH959=YtUvQkWriAk5w@mail.gmail.com
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
0 files changed, 0 insertions, 0 deletions