Skip to content

What should git-link do when the current local branch has commits that haven't been pushed yet? #133

Description

@snarfed

Hi @sshaw! First off, thanks (again) for writing and maintaining git-link all these years. It's great!

Sometimes I use git-link when I have commits in my local clone that haven't been pushed to the remote yet. git-link happily generates a link with the local head commit, but that link obviously doesn't work, at least not until the local commits get pushed.

Fixing this to use the remote's head commit could be pretty easy, we'd just add something like "--remotes=" (git-link--remote) to git-link--last-commit:

git-link/git-link.el

Lines 333 to 334 in 40f7b16

(defun git-link--last-commit ()
(car (git-link--exec "--no-pager" "log" "-n1" "--pretty=format:%H")))

...but the local commits may have changed the current file such that current point or region won't be the same thing in the remote's head commit.

Any idea what we should do?

Thanks in advance!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions