Skip to content

Work on gitx #302

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

Closed
wants to merge 15 commits into from
Closed

Work on gitx #302

wants to merge 15 commits into from

Conversation

tiennou
Copy link

@tiennou tiennou commented Mar 29, 2014

This is based on #301.

Modifications :

  • Adds more AppleScript so we can ask the main application to perform actions on our behalf instead of calling git. This effectively removes the dependency on git ;-).
    Note that I added a dependency on Objective-Git, so that gitx can warn execution outside of a working copy without distracting you by making GitX do it.
  • Make the gitx argument parsing handle file-system paths.
    This allows one to call gitx path/to/submodule, or gitx .. and have the window open at the correct location (see #8352816 for caveats though).
  • Adds an integrated Info.plist file to gitx so it doesn't rely on GitX for --version.
  • Various bells and whistles.

@tiennou
Copy link
Author

tiennou commented Mar 29, 2014

This fixes #291 and #278, though as I said I'm not sure how to best handle those rev-list arguments. Maybe the gitx parser should stop trying to look for repository path as soon as it hits a -- ?

@tiennou
Copy link
Author

tiennou commented Jul 12, 2014

Rebased.

tiennou added 15 commits July 30, 2014 21:56
Renamed to PBRepositoryFinder and cleaned up its methods.
Here are the steps it goes through :
1. If `--git-dir` is provided and points to a repository, return that. If it's not a repo, inform the user and exit.
	Handles `gitx --git-dir=path` or `gitx --git-dir path`.

2. Loops through the rest of the arguments for something that resolves to a repository.
	Handles `gitx ..`, `gitx path/to/submodule`.

3. Try to find a repository starting from the current working directory.
	Handles `gitx`.

4. Inform user that we couldn't find a repository and exit.

I'm not yet sure about step 2, because it somewhat conflicts with the current behavior if there's a directory with the same name as a branch. You'd end up resolving `branchname` as a repository (either as itself if it is one, or as your CWD) and cause the GitX window to reopen instead of filtering on the `branch name` branch.
This allows us to stop depending on `git` for the CLI tool.
Note that I'm not really fond of it, I'd prefer having real AppleScript arguments over passing a bunch of strings. But I'm not sure our CLI syntax is "strict" enough.
…ctually work.

Also, cleanup the weird `inWorkingDirectory:` arguments. We're the repository, we know where work from, thanks ;-).
This is to prevent `sdp` from inserting `NS_RETURNS_NOT_RETAINED` and triggering a warning. The old name is still there, as an hidden synonym.
@tiennou tiennou closed this Dec 9, 2016
@tiennou tiennou deleted the git-free-gitx branch December 9, 2016 22:52
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

Successfully merging this pull request may close these issues.

1 participant