Skip to content

Conversation

muram
Copy link

@muram muram commented Apr 30, 2025

Summary

This PR adds support for Azure DevOps URL handling in fzf-git.sh to correctly open commits, branches, files and tags in the browser using CTRL-O

Notable Changes

It detects Azure DevOps URLs and formats them correctly for:

  • Viewing commits with full commit hash
  • Browsing branches with proper path structure
  • Viewing files in the repository
  • Accessing tagged releases

The code handles both HTTPS and SSH URL formats for Azure DevOps and extracts the organization, project, and repository information to construct the correct web URLs.

Purpose

These changes ensure that when browsing git repositories hosted on Azure DevOps, clicking on commits and tags will open the correct URL in the browser.

@junegunn junegunn requested a review from Copilot April 30, 2025 15:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • fzf-git.sh: Language not supported

Comment on lines +155 to +157
org=$(echo "$clean_url" | sed -n 's|.*:v3/\([^/]*\)/.*|\1|p')
project=$(echo "$clean_url" | sed -n 's|.*:v3/[^/]*/\([^/]*\)/.*|\1|p')
repo=$(echo "$clean_url" | sed -n 's|.*:v3/[^/]*/[^/]*/\([^/]*\)$|\1|p')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like this?

IFS=/ read -r _ o p r <<< [email protected]:v3/org/project/repo
echo "$o/$p/_git/$r"

Comment on lines +144 to +146
# Remove .git suffix if present and any trailing slashes
clean_url=${remote_url%.git}
clean_url=${clean_url%/}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give some concrete examples?

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.

2 participants