1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

better handling of discarding files

This commit is contained in:
Jesse Duffield
2021-03-20 12:07:11 +11:00
parent 058bcddc53
commit ad1468f66f
67 changed files with 163 additions and 4 deletions

View File

@@ -0,0 +1 @@
three

View File

@@ -0,0 +1 @@
ref: refs/heads/conflict_second

View File

@@ -0,0 +1 @@
38b645bf2388b21695d22d7f673d87971a78e4ad

View File

@@ -0,0 +1,10 @@
Merge branch 'conflict' into conflict_second
# Conflicts:
# added-them-changed-us.txt
# both-added.txt
# both-deleted.txt
# both-modded.txt
# changed-them-added-us.txt
# deleted-them.txt
# deleted-us.txt

View File

@@ -0,0 +1 @@
c64dd6aea3efd197ed630dedc1ffb538d35c3fdb

View File

@@ -0,0 +1,10 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[user]
email = CI@example.com
name = CI

View File

@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@@ -0,0 +1,7 @@
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
.DS_Store

View File

@@ -0,0 +1,7 @@
0000000000000000000000000000000000000000 0e5c9fd43732ca064946e9c582fd6f159774db84 CI <CI@example.com> 1616203051 +1100 commit (initial): one
0e5c9fd43732ca064946e9c582fd6f159774db84 eb4814e3f9d5eb1869704cf4498420c9f4a141da CI <CI@example.com> 1616203051 +1100 commit: both-deleted.txt renamed in added-them-changed-us.txt
eb4814e3f9d5eb1869704cf4498420c9f4a141da 38b645bf2388b21695d22d7f673d87971a78e4ad CI <CI@example.com> 1616203051 +1100 commit: two
38b645bf2388b21695d22d7f673d87971a78e4ad 0e5c9fd43732ca064946e9c582fd6f159774db84 CI <CI@example.com> 1616203051 +1100 checkout: moving from conflict to conflict_second
0e5c9fd43732ca064946e9c582fd6f159774db84 698e214196fed018bb4164380745dd2df3bbac74 CI <CI@example.com> 1616203051 +1100 commit: both-deleted.txt renamed in changed-them-added-us.txt
698e214196fed018bb4164380745dd2df3bbac74 c64dd6aea3efd197ed630dedc1ffb538d35c3fdb CI <CI@example.com> 1616203052 +1100 commit: three
c64dd6aea3efd197ed630dedc1ffb538d35c3fdb c64dd6aea3efd197ed630dedc1ffb538d35c3fdb CI <CI@example.com> 1616203052 +1100 reset: moving to conflict_second

View File

@@ -0,0 +1,3 @@
0000000000000000000000000000000000000000 0e5c9fd43732ca064946e9c582fd6f159774db84 CI <CI@example.com> 1616203051 +1100 commit (initial): one
0e5c9fd43732ca064946e9c582fd6f159774db84 eb4814e3f9d5eb1869704cf4498420c9f4a141da CI <CI@example.com> 1616203051 +1100 commit: both-deleted.txt renamed in added-them-changed-us.txt
eb4814e3f9d5eb1869704cf4498420c9f4a141da 38b645bf2388b21695d22d7f673d87971a78e4ad CI <CI@example.com> 1616203051 +1100 commit: two

View File

@@ -0,0 +1,3 @@
0000000000000000000000000000000000000000 0e5c9fd43732ca064946e9c582fd6f159774db84 CI <CI@example.com> 1616203051 +1100 branch: Created from conflict
0e5c9fd43732ca064946e9c582fd6f159774db84 698e214196fed018bb4164380745dd2df3bbac74 CI <CI@example.com> 1616203051 +1100 commit: both-deleted.txt renamed in changed-them-added-us.txt
698e214196fed018bb4164380745dd2df3bbac74 c64dd6aea3efd197ed630dedc1ffb538d35c3fdb CI <CI@example.com> 1616203052 +1100 commit: three

View File

@@ -0,0 +1,2 @@
x��A
�@ @Q�s�� ��cR���U����)x|{�n?~���P�K�ܡG�tO�K�̔ʔ�kv�Et��W�`�a��������Z@B��㍠#B G=&�O�P��I�*�

View File

@@ -0,0 +1,2 @@
x��A
�0@Q�9E���L�d"BW=F&��`l)<�=���_�����Ʈj�TZ�ȹ���=��" �E)�Za��]�Æ�J�1���E<���j�ڜH.ћ��u��b��r�o��K/e�7�������@

View File

@@ -0,0 +1 @@
x��Aj�0E��)f_F�$[PJ!�c$}Ձ��r�:7��=�╭������;@�9K.1[N��m�A��6%D�4N��]v�J�PR�~�FW��O>"�0�Vc�!M��y�F�l;�/�u���)�~él��l�����ҧ����ǔ����M���E=�S�X��Jו�V�A��,����{E�VJK�

View File

@@ -0,0 +1 @@
38b645bf2388b21695d22d7f673d87971a78e4ad

View File

@@ -0,0 +1 @@
c64dd6aea3efd197ed630dedc1ffb538d35c3fdb

View File

@@ -0,0 +1 @@
blah2

View File

@@ -0,0 +1 @@
mod2

View File

@@ -0,0 +1 @@
change-delete

View File

@@ -0,0 +1 @@
delete-change

View File

@@ -0,0 +1 @@
del

View File

@@ -0,0 +1 @@
modded

View File

@@ -0,0 +1 @@
del

View File

@@ -0,0 +1 @@
double-modded

View File

@@ -0,0 +1 @@
mod

View File

@@ -0,0 +1 @@
mod

View File

@@ -0,0 +1 @@
renamed\nhaha

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,62 @@
#!/bin/sh
cd $1
git init
git config user.email "CI@example.com"
git config user.name "CI"
# common stuff
echo test > both-deleted.txt
git checkout -b conflict && git add both-deleted.txt
echo bothmodded > both-modded.txt && git add both-modded.txt
echo haha > deleted-them.txt && git add deleted-them.txt
echo haha2 > deleted-us.txt && git add deleted-us.txt
echo mod > modded.txt & git add modded.txt
echo mod > modded-staged.txt & git add modded-staged.txt
echo del > deleted.txt && git add deleted.txt
echo del > deleted-staged.txt && git add deleted-staged.txt
echo change-delete > change-delete.txt && git add change-delete.txt
echo delete-change > delete-change.txt && git add delete-change.txt
echo double-modded > double-modded.txt && git add double-modded.txt
echo "renamed\nhaha" > renamed.txt && git add renamed.txt
git commit -m one
# stuff on other branch
git branch conflict_second && git mv both-deleted.txt added-them-changed-us.txt
git commit -m "both-deleted.txt renamed in added-them-changed-us.txt"
echo blah > both-added.txt && git add both-added.txt
echo mod1 > both-modded.txt && git add both-modded.txt
rm deleted-them.txt && git add deleted-them.txt
echo modded > deleted-us.txt && git add deleted-us.txt
git commit -m "two"
# stuff on our branch
git checkout conflict_second
git mv both-deleted.txt changed-them-added-us.txt
git commit -m "both-deleted.txt renamed in changed-them-added-us.txt"
echo mod2 > both-modded.txt && git add both-modded.txt
echo blah2 > both-added.txt && git add both-added.txt
echo modded > deleted-them.txt && git add deleted-them.txt
rm deleted-us.txt && git add deleted-us.txt
git commit -m "three"
git reset --hard conflict_second
git merge conflict
echo "new" > new.txt
echo "new staged" > new-staged.txt && git add new-staged.txt
echo mod2 > modded.txt
echo mod2 > modded-staged.txt && git add modded-staged.txt
rm deleted.txt
rm deleted-staged.txt && git add deleted-staged.txt
echo change-delete2 > change-delete.txt && git add change-delete.txt
rm change-delete.txt
rm delete-change.txt && git add delete-change.txt
echo "changed" > delete-change.txt
echo "change1" > double-modded.txt && git add double-modded.txt
echo "change2" > double-modded.txt
echo before > added-changed.txt && git add added-changed.txt
echo after > added-changed.txt
rm renamed.txt && git add renamed.txt
echo "renamed\nhaha" > renamed2.txt && git add renamed2.txt

View File

@@ -0,0 +1 @@
{ "description": "discard file changes for various kinds of situations (merge conflicts, etc)", "speed": 2 }