jj icon indicating copy to clipboard operation
jj copied to clipboard

jj git push ignores multiple push urls

Open seankhliao opened this issue 1 year ago • 3 comments

Description

Steps to Reproduce the Problem

  1. git init
  2. git remote add origin https://example.com/upstream
  3. git remote set-url --add --push origin https://example.com/upstream
  4. git remote set-url --add --push origin https://example.com/mirror

verify the git config:

# .git/config
[remote "origin"]
	url = https://example.com/upstream
	fetch = +refs/heads/*:refs/remotes/origin/*
	pushurl = https://example.com/upstream
	pushurl = https://example.com/mirror
  1. jj git init --colocate
  2. make commits
  3. jj bookmark set main -r @-
  4. jj git push -b main

Expected Behavior

Like git, pushes changes to both urls.

Actual Behavior

Only pushes to the last defined pushurl.

This confused me since after a jj git push (which only pushed to my mirror), I did a jj git fetch (which pulled from upstream) and it wiped the commit.

Specifications

  • Platform: Linux zzz 6.11.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 01 Nov 2024 03:30:41 +0000 x86_64 GNU/Linux
  • Version: jj 0.23.0

seankhliao avatar Nov 16 '24 18:11 seankhliao

I actually didn't know that we support pushurls at all. Btw, note that we don't support refspecs.

martinvonz avatar Nov 16 '24 22:11 martinvonz

Are there any plans to add this functionality, or an equivalent? Pushing to multiple repositories at once is pretty critical to my workflow.

(I could, in theory, look into implementing this myself, but I am unfamiliar with jj's fairly large codebase, and this seems like it would be a strongly entangled change.)

dragonmaus avatar May 15 '25 16:05 dragonmaus

Is there any development plan? I really need this feature.

lowking avatar Jun 05 '25 06:06 lowking

I think this can be closed since as of v0.30.0 git is invoked as a process to handle fetch / push, and git does understand its own pushurls.

seankhliao avatar Nov 02 '25 00:11 seankhliao