WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#41078 new defect (bug)

Detect if someone’s site is under version control, and suggest better ways to edit their sites

Reported by: karmatosed Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:

Description

Can we detect if someone’s site is under version control, and suggest better ways to edit their sites if they try to make changes using the Code Editors?

Change History (3)

#1 @swissspidy
2 months ago

We already detect sites under version control for updates. See \WP_Automatic_Updater::is_vcs_checkout().

#2 @dd32
2 months ago

Unfortunately detecting this isn't exactly easy, nor ideal for a web app.

For example, older SVN created a .svn folder in each directory versioned, it was easy, just look for the folder!. Later SVN (1.7?) just added .svn to the root directory (Git is the same). The background upgrader currently looks in all directories up to / to determine if a site is under version control.

Unfortunately it doesn't really help to determine, if say, Theme X is under a version control system - or if it's the entire WordPress install under the VCS.. The best option would be to parse each VCS's data store to determine which files it's got under version control, but I don't think that's going to be a viable option for core (and also dealing with the many versions of said VCS's).

This ticket was mentioned in Slack in #core by melchoyce. View the logs.


2 months ago

Note: See TracTickets for help on using tickets.