After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702666 - Clone fails when the folder already exists
Clone fails when the folder already exists
Status: RESOLVED FIXED
Product: gitg
Classification: Applications
Component: gitg
git master
Other Linux
: Normal normal
: ---
Assigned To: Sindhu S
gitg-maint
Depends on: 699146
Blocks:
 
 
Reported: 2013-06-19 15:27 UTC by Erick Perez Castellanos
Modified: 2013-09-07 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Based on bug 699146, this routes clone repository dialog error's via a signal to show_infobar (3.31 KB, patch)
2013-06-22 13:25 UTC, Sindhu S
none Details | Review
Fix Clone Repository dialog error (2.52 KB, patch)
2013-09-03 16:46 UTC, Sindhu S
none Details | Review
Fix Clone Repository dialog error (2.47 KB, patch)
2013-09-07 13:48 UTC, Sindhu S
accepted-commit_now Details | Review

Description Erick Perez Castellanos 2013-06-19 15:27:09 UTC
The flow is this,
1. I have a path: "/tmp"
2. Inside it an empty folder gitg
3. Open gitg, click clone
4. URI: git://git.gnome.org/gitg; Local folder: /tmp
5. Hit [clone]

Gitg fails silently. How it fails: A new row appears, but there's no repo there. So when you click on it, no history loading at all.

PS: the problem should be with no communicating git return value, since git fails when cloning a repo to an existing path.
Comment 1 Sindhu S 2013-06-20 16:30:18 UTC
I can confirm this. I receive an message in terminal:

"** (gitg:22344): WARNING **: gitg-gtk-dash-view.vala:324: error creating subfolder: Error creating directory: File exists"

Changing bug status to 'NEW'.
Comment 2 Sindhu S 2013-06-20 16:59:58 UTC
I took a look at the code and https://git.gnome.org/browse/gitg/tree/libgitg-gtk/gitg-gtk-dash-view.vala#n324 can be routed to the proposed GtkInfobar?

This would also solve bug 699153, bug 699146 when we route those error messages through the Infobar :)
Comment 3 Sindhu S 2013-06-22 13:25:16 UTC
Created attachment 247514 [details] [review]
Based on bug 699146, this routes clone repository dialog error's via a signal to show_infobar

Please review, thanks!
Comment 4 jessevdk@gmail.com 2013-06-24 06:42:07 UTC
This doesn't look like the right approach to me. There will probably be many other cases where we need to show errors. What about adding a show_error function on GitgExt.Application, having Gitg.Window implementing it to show the error in the info bar?
Comment 5 Ignacio Casal Quinteiro (nacho) 2013-06-24 09:05:55 UTC
See that the dash is a widget, so we need a way to retrieve the error from it and not make it depend on GitgExt.Application...
Comment 6 jessevdk@gmail.com 2013-06-24 10:48:22 UTC
Ok, that makes sense. For plugins though, it would be nice to expose a show_error on GitgExt.Application.
Comment 7 Sindhu S 2013-07-14 18:27:25 UTC
Is this the commit https://git.gnome.org/browse/gitg/commit/?id=564f6da5d5e74a27f457d414092f390aba7e1889 that exposes show_infobar on GitgExt.Application?
Comment 8 Paolo Borelli 2013-09-02 13:21:02 UTC
Review of attachment 247514 [details] [review]:

This patch still makes sense though. Please rebase it to current master and push. Thanks!
Comment 9 Sindhu S 2013-09-03 16:46:57 UTC
Created attachment 253995 [details] [review]
Fix Clone Repository dialog error

The patch didn't apply cleanly because since the patch was written, a couple of things in the API have changed. Here's the fresh patch. Please review. Thank you.
Comment 10 Sindhu S 2013-09-07 13:48:46 UTC
Created attachment 254345 [details] [review]
Fix Clone Repository dialog error

Updated patch based on http://fpaste.org/37294/83853361/raw/ < review on IRC.
Please review, again. Thank you.
Comment 11 Paolo Borelli 2013-09-07 13:56:09 UTC
Review of attachment 254345 [details] [review]:

looks good
Comment 12 Sindhu S 2013-09-07 13:59:03 UTC
Pushed to master in e5c30050d011ac9deaa91cda90547ca08f308f3d
Available at:
https://git.gnome.org/browse/gitg/commit/?id=e5c30050d011ac9deaa91cda90547ca08f308f3d

Closing bug as RESOLVED and FIXED.

Thank you for the reviews.