centraldogma icon indicating copy to clipboard operation
centraldogma copied to clipboard

Directory history displays irrelevant changes

Open minwoox opened this issue 1 year ago • 10 comments

I've identified an issue where the history of a directory includes irrelevant changes when the modified files or directories share the same name as the target directory. For instance, the directory /a displays changes for /ab/a.txt, /a.json, and other unrelated items in its history.

image

minwoox avatar Dec 07 '23 11:12 minwoox

Hi @minwoox, as I understand, your a repository only has /ab/a.txt and /a.json, but the history includes /a_b/a.txt, right? Maybe I misunderstood because I can not reproduce on my local.

thachlp avatar Jan 24 '24 09:01 thachlp

your a repository

It's a directory and the history should show the history of the a directory only. However, it also displays the history of other files (e.g. /abc/a.txt) that are not related to the a directory. Please, let me know if you can't reproduce it. I will probably provide a repro for this. 😉

minwoox avatar Jan 24 '24 10:01 minwoox

Thanks for explaining to me. So the expected is that, even /ab/a.txt is a child of a, the history of a should only include files, not repository, right?

thachlp avatar Jan 24 '24 10:01 thachlp

even /ab/a.txt is a child of a

/ab/a.txt is not relevant to /a directory. It should show files in the directory such as /a/a.txt, /a/b.json. etc. 😉

minwoox avatar Jan 24 '24 10:01 minwoox

/a
├── a.txt
├── a.json
└── /ab
    ├── a.txt
    └── a.json

I mean here, the history of /a should only contain the history of /a/a.txt and /a/a.json?

Please help confirm to make sure I understand correctly 😁. If we require that, I will try to fix this.

thachlp avatar Jan 25 '24 02:01 thachlp

Sorry about the ambiguity in my comments. 😓

|---- foo (directory)
|     |---- bar.txt
|     |---- baz.json
|---- foobao (directory)
|     |---- bar1.txt
|     |---- baz1.json

When two different directories exist at the same level (e.g., foo and foobao), each directory should display its own history. However, if the name of another directory (foobao) starts with the directory name (foo), the history of the former directory is included in the latter's history.

minwoox avatar Jan 26 '24 01:01 minwoox

Thanks for clarifying, I can reproduce it now 👍 I will take this.

thachlp avatar Jan 26 '24 03:01 thachlp

@thachlp hey~ Any progress so far? 😄

minwoox avatar Feb 21 '24 08:02 minwoox

Not much, I have backed from 3 weeks vacation. I will continue this on this weekend 🚀🚀

thachlp avatar Feb 23 '24 09:02 thachlp

I tested on local with my pr:

CURRENT

/dogma Revision Summary Author Timestamp 5 Add /foo/baz2.txt admin 4 hours ago 4 Add /foo2/bar2.txt admin 14 hours ago 3 Add /foo/bar.txt admin 14 hours ago 2 Initialize metadata System 14 hours ago 1 Create a new repository System 14 hours ago

/foo Revision Summary Author Timestamp 5 Add /foo/baz2.txt admin 4 hours ago 4 Add /foo2/bar2.txt admin 14 hours ago 3 Add /foo/bar.txt admin 14 hours ago

/foo2 Revision Summary Author Timestamp 4 Add /foo2/bar2.txt admin 14 hours ago

BECOME

/dogma Revision Summary Author Timestamp 5 Add /foo/baz2.txt admin 4 hours ago 4 Add /foo2/bar2.txt admin 14 hours ago 3 Add /foo/bar.txt admin 14 hours ago 2 Initialize metadata System 14 hours ago 1 Create a new repository System 14 hours ago

/foo Revision Summary Author Timestamp 5 Add /foo/baz2.txt admin 4 hours ago 3 Add /foo/bar.txt admin 14 hours ago 1 Create a new repository System 14 hours ago

/foo2 Revision Summary Author Timestamp 4 Add /foo2/bar2.txt admin 14 hours ago 1 Create a new repository System 14 hours ago

It fixes the issue but includes revision 1 to /foo and /foo2 🧐 Please help review @minwoox 🙇

thachlp avatar Feb 25 '24 05:02 thachlp