Within ClearCase, we had the ability to create a labeled baseline which contained only the binary files modifed by specific change requests managed by ClearQuest. For reference, we are using Jira to do the same thing, with a custom integration. The question is how to create a Git branch with ONLY those versions of files referenced by a specific list of commit hashes and then archive only those files to a baseline .zip file.
Our company is migrating from ClearCase to Git. The code we deal with is NOT traditional text-based source. It is contained in binary objects created by proprietary vendor software, usually a .zip archive of other binary files. We store the binary objects as Git LFS objects. Since we are dealing with binary files, no merging is performed. We use LFS locks to guarantee single access to file and preventing the need to merge. Our programmers also do not work with command-line interfaces, such as bash. To them, dealing with an update of a "file" is check out, change, check in. The Git paradigm of lock, pull, edit, add, commit, unlock is beyond the scope of their capabilities. To maintain the ClearCase check out/check in paradigm, a number of wrapper scripts were created which hide the Git details from the programmer. These scripts are called from Windows Explorer context menu commands.
Having said all of that, PLEASE do not respond that we are misusing Git. It is a complicated tool that is not suitable for all programming environments. Git is, however, the most popular version control tool available at this time. And we have been able to preserve all of the ClearCase interface functionality that our programmers are familiar with.
The programmers do not use branches. We maintain a master branch only. Every wrapper command pulls and pushes to the origin master branch. Every file that is added, removed, or checked in, is done so under a separate commit.
The following steps are not performed by the typical programmer, only by the Git administrator.
Currently, we:
- create and checkout a branch
- create a list of hashes for the specific commits
- perform a
git rm -rf .
in the branch to get rid of everything - tried performing each of the following to populate just the files/commits we want
- a. checkout of each hash
- b. lfs checkout of each hash
- c. create a tag with the version string (e.g. v1.0)
- push the tag to origin
- checkout -f master to to get back to original condition
- perform git archive with version string to a zip file
Regardless of what we do, the git archive wants to include everything in the repo at the time of the last commit into the archive. This is the reason for step 3.
We tried a step 6.1 of just zipping the folder containing the project. All we get are the Git lfs ref files in the .zip which is the reason for trying steps 4 - a,b,c.
It seems that we are performing a lot of steps to accomplish something simple. It is possible that we are missing the obvious? Can anyone suggest a more straight-forward approach? Recall that the final .zip result must only contain the files modified by the specific commits.