Jump to content
deanishe

Find, filter, open Git repositories

Recommended Posts

I'll look into it, but it could potentially slow the workflow down a lot: it'd have to read each alfred-repos.json file before sending the results to Alfred, otherwise the subtitles would be incorrect.

Share this post


Link to post

That's doable, but require a much more significant rewrite. Still, definitely seems like a very useful feature, so probably worth the effort.

Share this post


Link to post

Thanks! Of all the workflows I've written, this is the one I use the most personally.

 

Many months later, this has also become my most used workflow, I run "update repos" the second I run "git init". Really love it.

 

However, funnily, without fail I always forget the hit modifier keys and open projects in the wrong IDE. When I need console or finder, I always remember, but the multiple IDEs are merged in my mind :)

Share this post


Link to post

Updated with some Alfred 3 goodness.

  • Now auto-reloads results when an update completes
  • Auto-updates list of repos when settings have changed
  • Better handing of remote/origin URLs
    • Can handle more URLs (not just GitHub and Bitbucket)
    • Add "meta" app `Browser`, which will open the URL in your default browser
  • Clearer naming of applications in settings: app_1 -> app_default, app_2 -> app_cmd etc.

Share this post


Link to post

I can't get rid of the new version line, it says 2.1.1 is available, I tried hitting enter on that line but nothing happened (also nothing happens in debugger at the point of clicking)

 

I tried updating from github releases, but still showing that line.

Share this post


Link to post

Still same problem. I even restarted Alfred in case it was cached.

 

Shows 2.1.2 under Alfred preferences, but when I call "repos", I still see "Version v2.1.1 is available" as one of the items in the list.

 

Share this post


Link to post

@deanishe I can't make exclude work, I tried these with and without an asterisk:

  "global_exclude_patterns": [
    "node_modules/*"
  ],          

and

"search_dirs": [
  {
    "depth": 5, 
    "name_for_parent": 1, 
    "path": "~/Code"
    "excludes": [
      "node_modules/*"
    ]
  }
]

I see one repo (a library I'm working on) showing up 4 times in the results, once for the original location and 3 times inside other projects /node_modules/ folders.

 

What am I doing wrong?

Thanks

Share this post


Link to post
9 hours ago, deanishe said:

depth=5 would be the obvious problem.

 

So exclude doesn't work with depth? Not all my repos are directly under ~/Code, some are deeper, is there a way to include them in the search but exclude node_modules?

Share this post


Link to post

exclude works fine with depth. depth=5 is in itself not ideal because you will end up searching a lot of directories.

 

Try “*/node_modules/*”.

Share this post


Link to post
On 18/03/2018 at 8:29 PM, somewhere2go said:

The select repository does not open with Atom application.

 

Works perfectly for me. The workflow's behaviour is entirely dependent on your settings file, so could you post the relevant parts on here, please?

 

Enter "reposettings" in Alfred to open your settings.json file.

Share this post


Link to post
Quote

Works perfectly for me. The workflow's behaviour is entirely dependent on your settings file, so could you post the relevant parts on here, please?

 

Enter "reposettings" in Alfred to open your settings.json file.

 

Thanks, now it works perfectly. Maybe for my mistake in the script.

Share this post


Link to post

@deanishe - I'm wondering, how does this workflow search for the app which we pass in the config?

 

I've been having issues forever with VSCode where right after it updates (for a day or two), this plugin would open the wrong VSCode and not the one from /Applications.

I tried setting the full path in the config and it seem to have solved the problem, but I'm wondering how it works, because I think I'm having similar issues with other editors as well (which could be in ~/Downloads AND in /Applications).

Share this post


Link to post
Posted (edited)

TL;DR: Put your apps in /Applications or ~/Applications. Otherwise, you'll have problems sooner or later.

 

1 hour ago, Maddog said:

how does this workflow search for the app which we pass in the config

 

It doesn't. It delegates opening stuff to the OS by calling open -a AppName /path/to/repo.

 

1 hour ago, Maddog said:

I think I'm having similar issues with other editors as well (which could be in ~/Downloads AND in /Applications)

 

In my experience, the bottom line is that if the application isn't in /Applications or ~/Applications, you're likely to have issues with it sooner or later.

 

It can cause problems simply having different versions of the same application installed (e.g. Alfred 2 and Alfred 3 cause conflicts). Multiple copies of the same version is a total crapshoot.

 

1 hour ago, Maddog said:

I tried setting the full path

 

But that should work.

 

All the same, it's safest to put your apps in /Applications or ~/Applications, and delete any other copies of the same app.

 

Edited by deanishe

Share this post


Link to post
2 hours ago, deanishe said:

All the same, it's safest to put your apps in /Applications or ~/Applications, and delete any other copies of the same app.

 

The update process for VSCode is putting some version (not sure if it's the new one or the old one) under /Library/Caches and for at least a couple of days after the update, I'd randomly get either the old or the new version. It's out of my control unfortunately. Hopefully now that I have the full path it won't happen anymore.

 

Thanks for the tip, I moved my other editor out of ~/Downloads.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×