Does Automatic Fork Syncing still work for forks of repositories that have had forking disabled?

We have forks disabled as a general rule. However, something we want to do requires us creating a fork.

If I take the following steps:

  1. Enable forking on repository A
  2. Create a new fork, repository B, with Fork Syncing enabled
  3. Disable forking on repository A again

Will repository B still be able to automatically sync any changes to A?

(The documentation on 'Disabling Forking' says "commits in the parent are viewable via the fork if the SHA1 hash is known to the user", but I don't know what that means. It sounds suspiciously like syncing won't work, but there's a manual workaround to keep getting updates.)

1 answer

1 accepted

Hi Graham,

Sorry for the delay. That scenario should be work fine. I've just taken a look at the code to be sure, and the only time we check that forks are enabled is showing the fork button and actually forking, everything else behaves regardless.

Does that put your mind at ease? :)

Charles

PS.

commits in the parent are viewable via the fork if the SHA1 hash is known to the user

So this is Git implementation details bleeding through. Technically Stash uses Git alternates to make forking effecient by sharing the parent objects. Regardless of syncing, if you push a commit to the parent repository after you sync, by definition that commit is now instantly available in _every_ child if you URL hack (and thus bypassing the permissions of the parent repository). I believe/suspect Github have the same behaviour.

Note that has no impact on fetching - only commits that are "reachable" via a ref are available to a Git client.

The nice thing about this is when we do ref sync it's basically "free" from a Stash diskspace perspective - the commits are only stored on disk once in the parent. :)

Make sense?

Thanks, Charles, that's great. It might be worth adding that detail (i.e. what the config doesn't disable) to the Forking Enabled config, as what I found in the docs didn't really clear it up. Cheers, Graham.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

136 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you