in Education by
Right now, we are using Perforce for version control. It has the handy feature of a strictly increasing change number that we can use to refer to builds, eg "you'll get the bugfix if your build is at least 44902". I'd like to switch over to using a distributed system (probably git) to make it easier to branch and to work from home. (Both of which are perfectly possible with Perforce, but the git workflow has some advantages.) So although "tributary development" would be distributed and not refer to a common revision sequencing, we'd still maintain a master git repo that all changes would need to feed into before a build was created. What's the best way to preserve strictly increasing build ids? The most straightforward way I can think of is to have some sort of post-commit hook that fires off whenever the master repo gets updated, and it registers (the hash of) the new tree object (or commit object? I'm new to git) with a centralized database that hands out ids. (I say "database", but I'd probably do it with git tags, and just look for the next available tag number or something. So the "database" would really be .git/refs/tags/build-id/.) This is workable, but I'm wondering if there is an easier, or already-implemented, or standard/"best practice" way of accomplishing this. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Monotonically increasing number corresponding to the current commit could be generated with git log --pretty=oneline | wc -l which returns a single number. You can also append current sha1 to that number, to add uniqueness. This approach is better than git describe, because it does not require you to add any tags, and it automatically handles merges. It could have problems with rebasing, but rebasing is "dangerous" operation anyway.

Related questions

0 votes
    Right now, we are using Perforce for version control. It has the handy feature of a strictly increasing ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Build can be triggered by a version control tool. (i)True (ii)False...
asked Oct 5, 2020 in Technology by Editorial Staff
0 votes
    I am relatively new to bazaar (primarily used cvs, then subversion, and at my current job we're ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Explain the difference between a centralized and distributed version control system (VCS)....
asked Oct 4, 2020 in Technology by Editorial Staff
0 votes
    Basically what I need is an automated way to update the product version number in WiX (3.0 with ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Basically what I need is an automated way to update the product version number in WiX (3.0 with ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Basically what I need is an automated way to update the product version number in WiX (3.0 with ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    ______ stores longer lived control data like component IP addresses and distributed locks. (1)Bulletin Board System (2)Consul (3)NATS (4)All the options...
asked Aug 24, 2021 in Technology by JackTerrance
0 votes
    When using Azure Resource Manager, you can use a _______________ for deployment, which can build identical environments ... work scenarios such as testing, staging, and production....
asked Dec 11, 2020 in Education by Editorial Staff
+1 vote
    When using Azure Resource Manager, you can use a _______________ for deployment, which can build identical environments ... work scenarios such as testing, staging, and production....
asked Oct 20, 2020 in Technology by JackTerrance
0 votes
    Which helps with sequencing the tasks one bye one? A. Only watch & plumber B. pipe C. plumber D. watch E. All the options...
asked Feb 3, 2023 in Technology by JackTerrance
0 votes
    I often run into the following problem. I work on some changes to a project that require new tables ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I've always just FTPed files down from sites, edited them and put them back up when creating sites, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Name the command to create a new directory under version control?...
asked Feb 21, 2021 in Technology by JackTerrance
0 votes
    Under Version control, how you will create a new directory in SVN?...
asked Feb 21, 2021 in Technology by JackTerrance
...