Detecting deleted, modified and new files for automated builds.

zdurban
zdurban
Im in the process of moving my companys opensource project from CVS to git and I need to modify our daily build scripts to use git commands instead of CVS commands. With a simple 'cvs update' command the build scripts on the build machine can infer the following information: $>cvs update U configure.in <--- This file was deleted locally and restored A newfile.c <--- This file was added R oldfile.c <--- This file was removed C Makefile <--- This file has a conflict M anotherfile.c <--- This file is modified If a line of output starts with 'U ', 'A ', or 'R ' than their has been changes to the central repository and a rebuild of the code initiated. If a line of output starts with 'C ' or 'M ' their is a conflict or a locally modified file and the build is aborted and a warning email sent out. If none of the letters is detected, nothing has changed, thus no build needs to be performed. Is it possible to issue a single git command on the build machine to determine the same, or similar, information as above with respect to the files on the build machine vs those in the central git repository? Is multiple commands required? Currently this is an automated task which directs the output of 'cvs update' to a file and then searches that file for lines starting with any of those letters, so something with similar output would be ideal tho not required. Thanks for any information you may provide.

Last updated

1-2 of 2

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply
941 views