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<01>ÍA
Â@ @Q×sŠì ¤cR¡ˆÐU<C390>§”)x|{„n?~ª¥¼PäKÛÜ¡GÔtO¨KÐ̔ʔ£kvæEt¶·WÝ`šaœæ§ÿ¬¬¿¦Z@BÂØã<C398> #B G=&ÍOòP¿þIÔ*Ê

View file

@ -0,0 +1,2 @@
x<01>ÎA
Â0@Q×9EöÌLÒd"BW=F&™ `l)<¾=ÛÏ_¼²öþ<13>Æ®j§TZ”ȹ¥œ…=£“" …E)¶Za³å]߯ÄJè1…¦<15>E<j¥ÚœH.Ñ›ü<19>u·ób¯ór×oîÛK/eí7<03>ƒ‰ìÀõ@ ýs7ãqÐÍÛ':G

View file

@ -0,0 +1 @@
x<01>Ž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;<3B>/ô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 }