Jason Stangroome
Jason Stangroome

Reputation: 4489

Should an automated build process commit changes to version control?

I have often seen automated build processes, including Continuous Integration builds, commit changes made to source files during the build back into the version control repository that the source originated from*. Auto-incrementing version numbers is a common scenario where this is done but there are others.

My intuition is that this is a bad idea as it can litter the repository history with build-related commits and the build process needs to prevent accidentally re-triggering itself. However I don't have any concrete evidence that committing changes during a build is best avoided.

Can anyone cite references discussing the pros and cons of commit changes to version control during an automated build?

*Committing changes to a separate artifact repository is perfectly acceptable.

Upvotes: 6

Views: 539

Answers (1)

VonC
VonC

Reputation: 1324937

Auto-incrementing version numbers

That is a metadata, and putting metadata in (versioned) data is "evil": for the pros and cons, see this answer.

Continuous Integration includes the build automation, which is about being able to reproduce a build from a fixed set of versioned data.
If you change anything back in that same set, you sort of defeat its purpose.

Upvotes: 1

Related Questions