Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"GitTfs.Core.GitTfsException: Nothing to checkin!" on "git tfs rcheckin" #1482

Open
JerrettDavis opened this issue Mar 13, 2024 · 5 comments

Comments

@JerrettDavis
Copy link

JerrettDavis commented Mar 13, 2024

We have a relatively simple setup where we need to periodically sync our main git branch with our tfs server. We typically manage this by using git tfs pull and then git tfs recheckin. We attempted a similar workflow today and we're receiving a message that seems to indicate an error on push.

PS C:\git\Proj> git tfs rcheckin -d
Command run:git tfs rcheckin -d
No authors file used.
git-tfs version 0.33.0.0 (TFS client library 16.0.0.0 (MS)) (64-bit)
git command: Starting process: git --version
git command time: [00:00:00.0468759] --version
Commits visited count:5
Commits visited count:5
Working with tfs remote: default => $/Support/Customers/Proj/Our Branch
Basing from parent 'default:135004', use -i to override
Fetching changes from TFS to minimize possibility of late conflict...
Establishing TFS credentials using user identity...
Identity-based VSS credentials created.
Commits visited count:1
Commit to checkin count:2
Working on the merge commit: da90d0e178d860a2071c4a0900386f4a2716d9df
Commits visited count:2
Starting checkin of da90d0e1 'Merge branch 'main' of https://dev.azure.com/<removed>/<removed>/_git/Proj

<REMOVED MESSAGE>'
Setting up a TFS workspace at .git\~w
git command: Starting process: git diff-tree -r -M -z 168f483e59dffc8f78363e3d957b8743b527781c da90d0e178d860a2071c4a0900386f4a2716d9df
TFS Workspace 'git-tfs-18e969d3-3440-407e-9da6-2cab9846434b;Jerrett Davis' was removed.
GitTfs.Core.GitTfsException: Nothing to checkin!
   at GitTfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) in C:\gittfs\src\GitTfs\Util\GitTfsCommandRunner.cs:line 36
   at GitTfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in C:\gittfs\src\GitTfs\GitTfs.cs:line 83
   at GitTfs.GitTfs.Run(IList`1 args) in C:\gittfs\src\GitTfs\GitTfs.cs:line 48
   at GitTfs.Program.Main(String[] args) in C:\gittfs\src\GitTfs\Program.cs:line 28
Nothing to checkin!
All the logs could be found in the log file: C:\Users\jdavis\AppData\Local\git-tfs\git-tfs_log.txt
PS C:\git\Proj> git log --all --decorate --oneline --graph
*   ad20943 (develop) Merge branch 'develop' of https://dev.azure.com/<REMOVED>/<REMOVED>/_git/Proj into develop
|\
| * 584a5df (HEAD -> main, origin/main, origin/develop, origin/HEAD, temp) <REMOVED>
* | a0711f3 
* | 7bad4e1 
* | 3553a40 
* | 78aceaf Merge branch 'update-develop' into develop
|\|
| *   da90d0e Merge branch 'main' of https://dev.azure.com/<REMOVED>/<REMOVED>/_git/Proj
| |\
| | * 5de6340 (tag: 15.4.5.006) 
| * | 168f483 (tfs/default) 
| |/
| *   613c8d4 
| |\
* | | 32d3a53 
* | | c34c884 
* | | 60bd803 
* | | a1984a0 
* | | 869fa11 
| |/
|/|
* |   f5fec3f [US0072201@@1] Merge branch 'develop' of https://dev.azure.com/<REMOVED>>/<REMOVED>/_git/Proj into develop
|\ \
| * | 9ae71b7 
* | | 18ec025 
| |/
|/|
* | b63bc6d 
|\|
| * 5fac546 
| * c1bdce1 
* | ccedfc2 
|/
* 7682669 
* f04c944 

Any ideas on what is happening here?

@pmiossec
Copy link
Member

No real idea but 2 things are coming into my mind:

  • do you reproduce with v0.32?
  • if you analyse the git commits, does the history seem good to you (and the git-tfs Metadata in the commit message)? and do you see commits that should be push? So do you think the problem is more in the rcheckin or is it more the pull that failed?

@JerrettDavis
Copy link
Author

Hi @pmiossec,
Great questions.

  • I did reproduce with v0.32, and that's where I initially noticed the problem. Upgrading to 0.33 did not correct it.
  • I'm admittedly not the best with the intricacies of git-tfs in terms of how the various metadata pieces work together. I don't notice anything immediately concerning. I'm working on sanitizing the git log output enough to post here to potentially provide a bit more insight.

@JerrettDavis
Copy link
Author

I've done my best to sanitize my git log while keeping any relevant details intact. Please let me know if there's anything immediately obvious.

PS C:\git\Proj> git log
commit 584a5df5bdbd48f3c86058015de49cf497d64d93 (HEAD -> main, origin/main, origin/develop, origin/HEAD, temp)
Author: JD Davis <jd.davis@email.com>
Date:   Wed Mar 13 21:18:45 2024 +0000

    [US0000000@@4][MERGE] Added latest integration components, process flows, and sql scripts

commit da90d0e178d860a2071c4a0900386f4a2716d9df
Merge: 168f483 5de6340
Author: JD Davis <jd.davis@email.com>
Date:   Thu Feb 22 19:38:57 2024 +0000

    Merge branch 'main' of https://dev.azure.com/<REMOVED>/<REMOVED>/_git/Proj

commit 168f483e59dffc8f78363e3d957b8743b527781c (tfs/default)
Author: Jerrett Davis <jdavis@email.com>
Date:   Thu Feb 22 15:04:22 2024 +0000

    [US0000000@@3] Release 15.4.5.006 to main

    git-tfs-id: <TFS_BRANCH>;C135004

commit 5de63400f1a104bf7dc1023a4b3750381bad9006 (tag: 15.4.5.006)
Author: JD Davis <jd.davis@email.com>
Date:   Thu Feb 22 15:00:41 2024 +0000

    [US0000000@@3] Release 15.4.5.006 to main

commit 613c8d4feb1cf29a39f327e6e18edaa0e0bd694e
Merge: b63bc6d f5fec3f
Author: Jerrett Davis <jdavis@email.com>
Date:   Wed Jan 31 22:35:47 2024 +0000


    [US0000000@@1] Merge branch 'develop' of https://dev.azure.com/<REMOVED>/<REMOVED>/_git/Proj into develop


    git-tfs-id: <TFS_BRANCH>;C134876

commit f5fec3f447914d8f2f0fd014ffa9b2e38716bc8c
Merge: 18ec025 9ae71b7
Author: JD Davis <jd.davis@email.com>
:...skipping...
commit 584a5df5bdbd48f3c86058015de49cf497d64d93 (HEAD -> main, origin/main, origin/develop, origin/HEAD, temp)
Author: JD Davis <jd.davis@email.com>
Date:   Wed Mar 13 21:18:45 2024 +0000

    [US0000000@@4][MERGE] Added latest integration components, process flows, and sql scripts

commit da90d0e178d860a2071c4a0900386f4a2716d9df
Merge: 168f483 5de6340
Author: JD Davis <jd.davis@email.com>
Date:   Thu Feb 22 19:38:57 2024 +0000

    Merge branch 'main' of https://dev.azure.com/<REMOVED>/<REMOVED>/_git/Proj

commit 168f483e59dffc8f78363e3d957b8743b527781c (tfs/default)
Author: Jerrett Davis <jdavis@email.com>
Date:   Thu Feb 22 15:04:22 2024 +0000

    [US0000000@@3] Release 15.4.5.006 to main

    git-tfs-id: <TFS_BRANCH>;C135004

@quetzalcoatl
Copy link

quetzalcoatl commented May 20, 2024

@JerrettDavis did you manage to get past that? Is it still an issue for you?

I'm writing because I got the same message a few times, out of a blue, and checked git-tfs code, and it turns out that this message sometimes shows up as a kind of 'fallback' error message. I can be wrong at the moment, it was ~2weeks ago, but when git-tfs tries to calculate the list of commits to send, it performs a few checks, and if something is "not perfect", the routine just aborts and returns empty set of commits - and outer layer panics with this message. But the actual reason could be other, it could have found few commits, but then failed those additional checks, but it wouldn't show the message about that.

I think one such case is i.e. when it cannot trace a clean linear path between your current HEAD at the moment of rcheckin to a parent which has git-tfs-id: <TFS_BRANCH>;Cxxxxx annotation. I.e. if you played hard with rebases and you've nontrivially messed up the trees/chains that git-tfs built during fetch.. But I'd need to analyze the commit-graph you pasted and maybe iteratively ask you for more similarly-sanitized log entries. Not much point in burning the time if you've managed to move forward :)

@siprbaum
Copy link
Member

@JerrettDavis Did you solve this?

If not, any chance the merge result da90d0e178d860a2071c4a0900386f4a2716d9df is empty, meaning there are not changes
for the command
git diff-tree -r -M -z 168f483e59dffc8f78363e3d957b8743b527781c da90d0e178d860a2071c4a0900386f4a2716d9df
returned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants