This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 237886 - Cannot pull from upstream if branch is removed by another user
Summary: Cannot pull from upstream if branch is removed by another user
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-01 12:31 UTC by misterm
Modified: 2013-11-02 11:45 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (242.39 KB, application/octet-stream)
2013-11-01 13:32 UTC, misterm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2013-11-01 12:31:39 UTC
Steps to reproduce:

1. User A creates a repository and creates branches master and dev;
2. User B clones it, fetching both branches, and creating a new branch dev from origin/dev;
3. User B switches to branch origin/master creating branch master;
4. User A deletes branch dev and pushes it to remote;
5. User B tries use Pull from upstream.

It will fail and there is no way of fixing except by editing git files by hand.
Comment 1 Ondrej Vrabec 2013-11-01 13:10:47 UTC
i can pull without problems:
1) delete branch in the remote repository:
==[IDE]== Nov 1, 2013 2:05:57 PM Deleting Branch dev
git branch -d dev
git branch -D dev
=====
2) and when pulling to local "master":
==[IDE]== Nov 1, 2013 2:06:37 PM Pulling - 237886
git fetch /home/ondra/NetBeansProjects/git/237886/1/237886 +refs/heads/*:refs/remotes/origin/*
Branch  : origin/master
Old Id : 0df50522466c16a0625182d754d362167a6f017b
New Id : e4124adc7aa1058eaf0007cb0b8eb92850428337
Result : FAST_FORWARD
Show changes in [Search History] or as [Diff]

git merge origin/master
Merge Result: Fast-forward
Merge of HEAD with origin/master:
Commit Log
revision   : e4124adc7aa1058eaf0007cb0b8eb92850428337
author     : Ondrej Vrabec <ondrej@vrabec.cz>
date       : Nov 1, 2013 2:06:27 PM
summary    : aaa
Show changes in [Search History] or as [Diff]
==[IDE]== Nov 1, 2013 2:06:37 PM Pulling - 237886 finished.


You know how this ends: i close it as worksforme because once again you haven't even attached the messages.log. Plus please also :
> It will fail
and what about pasting here the error message? The IDE usually says why a git command fails, didn't it this time?

> there is no way of fixing except by editing git files by hand.
Will you share with me what you had to fix manually? What did .git/config look like before and after you modified it?

And attach the messages.log. And please try attaching it every time so we skip the usual WORKSFORME/INCOMPLETE status -> REOPEN with attached messages.log. You know i don't avoid fixing bugs in Git but please try to provide as much information every time you file a bug. Thanks.
Comment 2 misterm 2013-11-01 13:30:15 UTC
Your pull is not trying to pull dev, so either I missed something in my instructions or you didn't quite get what I meant. I will attach the info you want.
Comment 3 misterm 2013-11-01 13:30:45 UTC
Message: Remote does not have refs/heads/release-2013-10-01 available for fetch.
Comment 4 misterm 2013-11-01 13:32:36 UTC
Created attachment 141772 [details]
messages.log
Comment 5 misterm 2013-11-01 13:32:59 UTC
How to fix it: remove branch from fetch configuration.
Comment 6 Ondrej Vrabec 2013-11-01 13:37:22 UTC
please note that we no longer add specific branch to fetch= spec, we always set it to fetch = +refs/heads/*:refs/remotes/origin/*
You must have cloned it with 7.3 or older. With this global spec we don't get into these kinds of problems, i suggest you re-clone or simply fix it in the .git/config file.
Comment 7 misterm 2013-11-01 13:49:14 UTC
Hmmm, I wonder if there should be any checkbox in the Fetch or Pull dialogs that allow all fetches to be replaced by the new format instead.
Comment 8 Ondrej Vrabec 2013-11-01 15:21:52 UTC
i'll try to hack fetch and pull actions to work around it and if a fetch fails because of a missing head in a remote repository the fetch will be restarted without the specific fetch specs. Still it would be useful to implement bug #191540 to let user edit the remote in the IDE and let him remove/add fetch specs or replace them with the universal global spec.

fix: http://hg.netbeans.org/core-main/rev/ba8ac5b3ec9c
Comment 9 Quality Engineering 2013-11-02 11:45:55 UTC
Integrated into 'main-silver', will be available in build *201311020744* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ba8ac5b3ec9c
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #237886 - Cannot pull from upstream if branch is removed by another user