Nguyễn Thái Ngọc Duy
a7256debd4
checkout.txt: note about losing staged changes with --merge
...
If you have staged changes in path A and perform 'checkout
--merge' (which could result in conflicts in a totally unrelated path
B), changes in A will be gone. Which is unexpected. We are supposed
to keep all changes, or kick and scream otherwise.
This is the result of how --merge is implemented, from the very first
day in 1be0659efc (checkout: merge local modifications while switching
branches., 2006-01-12):
1. a merge is done, unmerged entries are collected
2. a hard switch to a new branch is done, then unmerged entries added
back
There is no trivial fix for this. Going with 3-way merge one file at a
time loses rename detection. Going with 3-way merge by trees requires
teaching the algorithm to pick up staged changes. And even if we detect
staged changes with --merge and abort for safety, an option to continue
--merge is very weird. Such an option would keep worktree changes, but
drop staged changes.
Because the problem has been with us since the introduction of --merge
and everybody has been pretty happy (except Phillip, who found this
problem), I'll just take a note here to acknowledge it and wait for
merge wizards to come in and work their magic. There may be a way
forward [1].
[1] CABPp-BFoL_U=bzON4SEMaQSKU2TKwnOgNqjt5MUaOejTKGUJxw@mail.gmail.com
Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk >
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2019-03-21 12:07:41 +09:00
..
2019-02-06 22:05:25 -08:00
2018-11-21 22:58:08 +09:00
2019-02-13 18:18:43 -08:00
2019-02-05 14:26:14 -08:00
2018-08-06 12:30:23 -07:00
2017-01-31 12:18:18 -08:00
2017-02-24 10:48:08 -08:00
2017-01-23 10:56:47 -08:00
2015-05-21 13:03:37 -07:00
2018-10-19 13:34:05 +09:00
2018-11-21 22:58:01 +09:00
2017-01-17 15:19:08 -08:00
2018-11-26 15:59:14 +09:00
2017-03-02 11:40:51 -08:00
2019-01-29 12:47:53 -08:00
2019-02-06 22:05:30 -08:00
2016-05-09 15:44:14 -07:00
2018-09-17 13:54:00 -07:00
2019-01-23 11:37:29 -08:00
2018-03-06 14:54:02 -08:00
2018-05-25 17:16:47 +09:00
2018-06-25 13:22:36 -07:00
2018-09-21 09:28:58 -07:00
2018-10-23 12:23:09 +09:00
2018-04-25 13:28:56 +09:00
2017-11-02 14:51:24 +09:00
2019-01-23 11:37:29 -08:00
2018-05-02 17:03:33 +09:00
2019-02-06 22:05:21 -08:00
2018-05-25 17:16:47 +09:00
2018-05-25 17:16:47 +09:00
2018-05-25 17:16:47 +09:00
2017-12-19 10:00:45 -08:00
2019-03-21 12:07:41 +09:00
2019-01-23 11:37:29 -08:00
2016-06-28 08:20:52 -07:00
2018-11-16 13:15:21 +09:00
2018-12-26 15:29:30 -08:00
2018-09-27 15:29:12 -07:00
2016-07-28 11:25:54 -07:00
2019-02-04 10:00:01 -08:00
2018-10-22 13:17:04 +09:00
2016-10-10 13:52:37 -07:00
2018-05-25 17:16:47 +09:00
2018-05-25 17:16:47 +09:00
2016-10-03 13:22:25 -07:00
2018-05-25 17:16:47 +09:00
2018-02-05 10:30:44 -08:00
2018-09-21 09:32:21 -07:00
2018-05-02 17:03:33 +09:00
2019-02-04 12:39:13 -08:00
2019-01-23 11:37:29 -08:00
2017-02-08 13:30:28 -08:00
2018-11-17 18:43:52 +09:00
2018-11-17 18:43:52 +09:00
2018-04-09 14:15:02 +09:00
2019-01-23 11:37:29 -08:00
2018-05-23 14:38:22 +09:00
2018-10-29 10:17:01 +09:00
2018-12-28 10:08:11 -08:00
2019-01-23 11:37:29 -08:00
2019-01-08 09:41:06 -08:00
2019-01-08 11:14:04 -08:00
2015-10-16 15:27:52 -07:00
2018-10-03 21:25:57 -07:00
2017-01-13 12:23:28 -08:00
2015-10-16 15:27:52 -07:00
2019-01-23 11:37:29 -08:00
2016-06-08 12:04:37 -07:00
2018-04-24 10:55:02 +09:00
2018-05-02 17:03:33 +09:00
2018-10-29 10:17:02 +09:00
2018-05-02 17:03:33 +09:00
2019-02-06 22:05:21 -08:00
2019-01-28 10:57:44 -08:00
2018-11-21 22:57:42 +09:00
2019-01-22 14:16:17 -08:00
2018-05-23 14:38:23 +09:00
2018-05-23 14:38:15 +09:00
2017-03-02 11:40:51 -08:00
2016-05-26 13:17:14 -07:00
2016-06-06 11:14:43 -07:00
2018-10-23 12:23:09 +09:00
2015-10-29 12:10:23 -07:00
2018-10-29 10:17:03 +09:00
2018-10-25 14:01:10 +09:00
2015-10-16 15:27:52 -07:00
2018-04-09 14:15:07 +09:00
2018-09-17 13:49:38 -07:00
2016-06-28 08:20:52 -07:00
2018-05-02 17:03:33 +09:00
2018-06-22 14:26:23 -07:00
2019-01-23 11:37:29 -08:00
2019-01-17 13:44:39 -08:00
2017-07-28 14:41:32 -07:00
2018-05-02 17:03:33 +09:00
2018-05-25 17:16:47 +09:00
2018-11-14 15:27:56 +09:00
2019-01-07 15:29:34 -08:00
2018-11-12 12:05:38 +09:00
2018-05-02 17:03:33 +09:00
2019-02-14 14:28:22 -08:00
2018-05-02 17:03:33 +09:00
2018-10-22 13:32:54 +09:00
2018-05-02 17:03:33 +09:00
2016-08-11 14:35:42 -07:00
2018-06-04 21:39:49 +09:00
2018-09-17 13:53:55 -07:00
2018-04-30 11:12:30 +09:00
2018-05-02 17:03:33 +09:00
2018-08-29 09:03:29 -07:00
2019-01-23 11:37:29 -08:00
2017-11-22 14:11:57 +09:00
2018-05-25 17:16:47 +09:00
2016-06-28 08:36:45 -07:00
2017-08-23 12:17:22 -07:00
2019-01-23 11:37:29 -08:00
2018-05-02 17:03:33 +09:00
2016-06-08 12:04:37 -07:00
2018-05-02 17:03:33 +09:00
2018-04-18 12:49:26 +09:00
2018-10-18 12:26:51 +09:00
2018-05-29 00:28:22 +09:00
2019-01-10 10:29:05 -08:00
2018-05-25 17:16:47 +09:00
2018-03-27 19:09:13 -07:00
2018-12-26 15:29:30 -08:00
2015-10-16 15:27:52 -07:00
2018-06-25 13:22:35 -07:00
2018-06-22 14:26:23 -07:00
2019-01-23 11:37:29 -08:00
2017-04-20 22:05:37 -07:00
2016-08-24 12:31:05 -07:00
2018-08-20 11:33:50 -07:00
2018-11-21 22:58:07 +09:00
2015-10-22 10:16:12 -07:00
2019-01-23 11:37:29 -08:00
2018-05-02 17:03:33 +09:00
2016-07-06 13:06:36 -07:00
2015-05-17 11:24:57 -07:00
2017-01-17 16:10:22 -08:00
2018-05-25 17:16:47 +09:00
2018-11-13 22:37:26 +09:00
2018-11-21 22:58:07 +09:00
2019-02-06 22:05:23 -08:00
2018-05-25 17:16:47 +09:00
2017-08-23 12:17:22 -07:00
2018-09-27 15:24:50 -07:00
2017-02-15 12:54:20 -08:00
2018-12-26 14:59:37 -08:00
2018-06-22 14:26:23 -07:00
2017-02-09 15:14:01 -08:00
2018-08-01 13:37:18 -07:00
2018-11-13 22:37:19 +09:00
2018-04-18 12:49:26 +09:00
2018-10-23 12:23:09 +09:00
2016-11-14 11:23:07 -08:00
2018-05-08 15:59:16 +09:00
2018-11-16 14:10:31 +09:00
2018-08-31 14:04:06 -07:00
2018-10-23 12:23:09 +09:00
2017-02-09 15:14:01 -08:00
2017-08-23 12:17:22 -07:00
2019-01-14 15:29:33 -08:00
2017-05-15 13:04:54 +09:00
2018-06-18 10:18:42 -07:00
2018-11-19 10:50:33 +09:00
2017-07-17 15:11:26 -07:00
2017-12-12 16:49:40 -08:00
2015-04-20 11:05:50 -07:00
2016-05-10 11:15:04 -07:00
2019-01-07 13:05:36 -08:00
2018-02-16 11:22:43 -08:00
2018-05-08 16:19:41 +09:00
2019-02-08 20:44:53 -08:00
2016-07-06 13:06:34 -07:00
2018-09-20 09:40:03 -07:00
2019-02-06 22:05:24 -08:00
2018-07-24 14:50:49 -07:00
2018-08-21 12:54:33 -07:00
2017-01-23 10:56:53 -08:00
2016-11-14 11:23:07 -08:00
2015-10-22 10:16:12 -07:00
2016-02-01 13:07:41 -08:00
2017-12-06 07:32:40 -08:00