vsts - Files on Visual Studio Team Services out of sync (Git repo) -


probably missing trivial here struggling figure way out..

we have git repository setup on visual studio team services. since 1st february, several files seem have gone out-of-sync history of commits. history contains loads of recent changes, when pulling latest version, old copies.

it not clear if in team might have accidentally issued weird commands on remote repository.

what quite clear though, "current" remote versions visible via vsts web portal seem older should according history (so not issue local repos).

below 1 example:

current version

current version (latest - not.latest)

changes history

file history

latest commit

latest commit

even though last commit shows few new lines added, 'current version' of file doesn't contain them.. , there no further commits in history!

any suggestions on how verify happening remote repo , fix it, or whether known issue on vsts (they have been having problems , service down yesterday..)

this due botched merge. happened did pull, got conflicts, resolved said conflicts, noticed before committing merge had bunch of staged changes not (and not related conflicts in way). figures weird git bug or something, , discards changes, commits. discarded changes ones missing; should have been committed merge. reason why not see "undoing" commit in history file that, default, git (and other tools) not show merge commits in file histories unless file different both of merge parents. if git log <filename> --full-history, should see merge commit reverted file older version. moral of story: when committing merge, commit staged changes, if (or if) did not make them.

edit: 1 dangerous thing botched merges can happen without noticing quite while, since don't show in default git log of file(s) changes lost. following script detect botched merges, reporting files have lost changes. tweaked used commit hook, check commits, etc. works seeing if there files reverted merge state @ when 2 branches last diverged.

note total newbie when comes shell scripting, please forgive poor code quality.

ischangeinbasechanges() {   element in ${basechanges[@]};      if [ $element == $change ]              return 1     fi    done   return 0 }    merge in `git rev-list --min-parents=2 --all`;   mergechanges=`git log -m -1 --name-only --pretty="format:" $merge | sort -u`   mergebase=`git merge-base $merge^ $merge^2`     basechanges=`git diff --name-only $merge $mergebase`    lostfiles=()   change in ${mergechanges[@]};      ischangeinbasechanges      if [ $? -ne 1 ]             lostfiles+=($change)      fi    done    if [ ${#lostfiles[@]} -ne 0 ]       echo -n "possible botched merge @ "     echo  $merge     echo "files lost changes are: "     lostfile in ${lostfiles[@]};       echo $lostfile     done     echo --------------------------------------------   fi  done 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -