Compared to older generations, 3rd gen version control...
- Enables the use of multiple branches
- Does not require an Internet connexion to commit
- Does not require a central server
- Automatically resolves conflicts
Click to show the answer
2 & 3: Each developer's machine has a full copy of the entire repository, and thus developers can work independently and push wherever they want, though teams typically treat one location, such as GitHub, as the source of truth. Branches already existed before, and conflicts cannot always be resolved automatically since they involve human opinions.
Which of the following workflows make sense?
- Commit, add, push
- Push, pull, commit
- Add, commit, push
- Pull, merge, push
Click to show the answer
3 & 4: These are common workflows when using version control. Adding after committing does not make sense, and neither does pulling immediately after pushing.
Commit messages should...
- Be less than 127 characters long
- Start with a summary
- Describe how newly-added code works
- Be written with curious users in mind
Click to show the answer
2: Commit messages should start with a summary making logs easy to review, but they do not need to overall have a certain length, should not contain implementation details, and should be targeted at teammates rather than users.
Which of these commit messages are useful?
Checkpoint
Apply changes discussed in person
Refactor UI tests to match the style of other tests
Forbid ordering a negative number of books, fixing bug #234
Click to show the answer
3 & 4: Both have enough content to describe what they do in a log. Including a bug number can be useful but is not required. However, referring to an offline discussion is useless for anyone who was not part of it, and even for those who were since they are likely to forget after a while.
Continuous Integration involves...
- Compiling the code every few hours
- Automatically removing bugs from new commits
- Building new commits when they are pushed
- Running various tools on new commits when they are pushed
Click to show the answer
3 & 4: When a commit is pushed, continuous integration involves at a minimum compiling the code, and possibly also running other tools such as static analyzers to find possible bugs. However, no tool can automatically remove bugs, and continuous integration depends on pushes rather than time.