git different result file history vs branch

98 views Asked by At

I am having trouble with our repository : showing the particular file history I get less commits, than showing the complete branch/repository history. (Clear that it differs, but some commits - containing particular files - do not appear, if I am displaying the file related history.) Even worse, a checkout of the newer commits, are giving back older versions, than the last commit of the file. Example : a.c is in branch history 5 times shown. If I am displaying the file history of a.c, I get for example one commit less shown. Repository is up to date (local and remote) I am using egit / eclipse - but console has same effects

When I am checking out the last commit/or branch - I get an older version of a.c than the last committed one ! Or when I am newly cloning the repository I get a much older state (of some files) than than the current one - in my normal repository

How can this happen ? How can this be solved ?

Thanks in advance

CS

I will try to add an example :

| path | BLOB | date | Commit | user Name | | a.c | 074aba | 16.12.2016 16:24 | 23e4d4 | User1 | | a.c | 074aba | 16.12.2016 12:35 | f517a0 | User2 | | a.c | 074aba | 16.12.2016 12:33 | 4b52b2 | User2 | | a.c | 074aba | 16.12.2016 11:25 | f17354 | User3 | | a.c | 074aba | 16.12.2016 10:43 | 9f377e | User2 | | a.c | 074aba | 16.12.2016 10:43 | a04e31 | User2 | | a.c | 074aba | 15.12.2016 19:39 | b47203 | User1 | | a.c | 074aba | 15.12.2016 19:38 | 048600 | User1 | | a.c | 074aba | 15.12.2016 17:55 | f10cbc | User4 | | a.c | 074aba | 15.12.2016 17:30 | c26862 | User5 | | a.c | 074aba | 15.12.2016 17:28 | 66635d | User5 | | a.c | 074aba | 15.12.2016 16:49 | e72066 | User4 | | a.c | 074aba | 15.12.2016 16:26 | fb1dee | User5 | | a.c | 074aba | 15.12.2016 16:26 | d205a7 | User5 | | a.c | 074aba | 14.12.2016 15:13 | 8f78e3 | User3 | | a.c | 074aba | 14.12.2016 15:09 | 404690 | User3 | | a.c | 074aba | 14.12.2016 15:04 | bbab2a | User3 | | a.c | 074aba | 14.12.2016 14:19 | 2180aa | User6 | | a.c | 227bd1 | 14.12.2016 14:18 | ce4dc7 | User6 | | a.c | 227bd1 | 14.12.2016 13:21 | 4c135c | User6 | | a.c | 074aba | 14.12.2016 10:39 | 0fd1c3 | User7 | | a.c | 074aba | 14.12.2016 10:22 | 839ec8 | User7 | | a.c | 074aba | 13.12.2016 18:13 | 860ef7 | User2 | | a.c | 074aba | 13.12.2016 18:11 | 7d752b | User2 | | a.c | 074aba | 13.12.2016 16:42 | 5a7770 | User5 | | a.c | 074aba | 13.12.2016 15:50 | c4a173 | User5 | | a.c | 227bd1 | 13.12.2016 14:15 | 1a6044 | User6 | | a.c | 074aba | 13.12.2016 11:55 | 02852f | User3 | | a.c | 074aba | 13.12.2016 11:26 | 506d9f | User3 | | a.c | 074aba | 13.12.2016 11:15 | be6b93 | User3 | | a.c | 074aba | 13.12.2016 09:38 | 8491a3 | User2 | | a.c | 074aba | 12.12.2016 13:26 | 7ac6ce | User8 | | a.c | 227bd1 | 12.12.2016 09:44 | b47bd1 | User6 | | a.c | 074aba | 09.12.2016 08:28 | cdbca3 | User7 | | a.c | 227bd1 | 09.12.2016 06:45 | 6ab615 | User6 | | a.c | 074aba | 08.12.2016 17:11 | 078964 | User2 | | a.c | 227bd1 | 08.12.2016 15:44 | f14d9f | User6 | | a.c | 227bd1 | 08.12.2016 15:12 | 38ea88 | User6 | | a.c | 227bd1 | 08.12.2016 15:12 | f577aa | User6 | | a.c | 074aba | 08.12.2016 07:54 | d5ba9e | User7 | | a.c | 227bd1 | 07.12.2016 14:50 | 2ee1e6 | User6 | | a.c | 074aba | 06.12.2016 16:18 | 49fab0 | User2 | | a.c | 074aba | 06.12.2016 13:25 | 1921dd | User8 | How can it happen, that - without any conflict message - the most recent version 227bd1 is multiple times overwritten ? - by different users. Originally introduced by user 6, who updated repeatingly with his version. Multiple users are committing and pushing to one central repository an branch master. The table was build of git ls-tree and git log pulled together into a database to have the commit and BLOB in one view

Help and ideas are very appreciated. For us it is not clear, if we are using git in a wrong way, or how we get it corrupted. Or may be we have wrong expectations to the git repository.

thanks in advance CS

1

There are 1 answers

0
sqller On

Ok meanwhile we know the root cause : we have been confused on a very "old" pending commit/push of a new user. All users use pull (instead of fetch + merge) This user got a long list of changed files (in the index) due to one single conflicting file + all others that he never touched. When he solved his conflict, he removed all files, he never touched from the index - and later hard reset. Since commits consist of all files, but not explicitly changed are not visible as part of the commit, such issues are nearly impossible to find ! Consistency checks of such issues would be a nice feature. (More recent merge commits should not contain older file versions)