Open Source Software
Скачать 1.28 Mb.
|
Using Git (An Example) 1. Вопрос 1 How can you get a brief list of all git subcommands? man git-help git Правильно Just typing git will do it 2. Вопрос 2 Which command initializes a new Git repository: git new git log git init Правильно This populates the .git directory 3. Вопрос 3 How would you store in the repository the user's name and email address? git set user.name "myname" ; git set user.email "me@linux git setinfo user.name "myname" ; git setinfo user.email "me@linux git config user.name "myname"; git config user.email "me@linux" Правильно This will store this information in .git/config. You can also put such information in $HOME/.gitconfig so you don't have to put it in all repositories 4. Вопрос 4 Which command places new files in the repository? git commit git log git add Правильно This adds new (and/or updated files) to the repository 5. Вопрос 5 Which command puts changes in the repository? git add git commit git log Правильно This puts all changes in the repository. It is often combined with the -a option to make sure all modified files are properly updated. Week 2 Git Concepts and Architecture 1. Вопрос 1 In git, the fundamental content-full object that is stored, is called a: directory file blob deposit Правильно Binary blobs are the fundamental object 2. Вопрос 2 When a repository is "forked", the new repository Is structurally equal to the old one and contains the entire history Is structurally equal to the old one, but does not contain the entire history Правильно There is no structural difference 3. Вопрос 3 Publishing a repository means: Making the results visible and available to other contributors Posting a "come and get it" notice on a mailing list Doing a git commit Правильно This generally involves a push (or commit) to a repository visible over the network to permitted collaborators 4. Вопрос 4 Upstream and downstream git repositories are: Structurally the same; it is a socio-political decision which repositories are upstream or downstream Fundamentally different; it is structurally impossible to bring changes from the downstream repository to the upstream one Правильно This is the correct answer 5. Вопрос 5 The long hexadecimal numbers associated with git commits: Are computed using this weeks football scores to achieve randomness Serve as both identifiers and helpful checksums Are designed to confuse hackers Правильно This is correct Managing Files and the Index 1. Вопрос 1 An "ignored" file in git is one that: Has never been added to the repository Exists in the working tree, but has never been added to the project Is enumerated in a .gitignore file Does not belong to the project owner Правильно It must be in a .gitignore file, either by complete name or wildcard 2. Вопрос 2 The command git rm some_file: Removes some_file from working file tree, but not from the repository Removes some_file from the repository, but not from the working file tree Removes some_file from the working file tree and the index Правильно It is removed from the working tree and the index 3. Вопрос 3 The command rm some_file Removes some_file from working file tree, but not from the repository Removes some_file from the repository, but not from the working file tree Removes some_file from the repository and from the working file tree Правильно It is removed only from the working tree, the repository is unchanged 4. Вопрос 4 To list all files in the repository, issue the command: git ls-files git dump-list git ls git log --numstat Правильно This is the correct command 5. Вопрос 5 The command git mv some_file new_name_or_location Moves the file only in the repository Moves (renames) the file in both the repository and the working tree Moves the file only in the working tree Правильно Commits 1. Вопрос 1 What does the command git revert c87e6ae4 do? Removes all changes and history after commit c87e6ae4 Has no effect Removes the changes associated with the commit that starts with c87e6ae4 Places the repository where it was after commit c87e6ae4 but does not revert later changes Правильно It both removes the changes and takes you back 2. Вопрос 2 To see which files have changed and what the exact changes are, do: git log --numstat git log --pretty=oneline git log git log -p Правильно This gives details, including file names and changes 3. Вопрос 3 Some time over the past 1000 commits, a change was introduced that caused a program to fail. Assuming you have a good test to establish a bad version, what is the largest number of bisects that should be needed to locate the commit containing the defective patch? 4 16 32 8 2 10 Правильно Each bisect cuts the number in half 4. Вопрос 4 In the command git gc, what does gc stand for? GNU cleanup garbage corruption generic concentration garbage collection Правильно This is a common abbreviation 5. Вопрос 5 The command git blame some_file: Evaluates whether the error is due to a problem with some_file Sends an email to a mailing list explaining whose fault an error is Tells you where every line in some_file came from by date and author Finds some obvious errors in some_file Правильно This is extremely useful in tracking down problems and establishing ownership if there are legal problems Branches 1. Вопрос 1 In Git, branching is the inverse process to: committing merging pushing forking Правильно Merging is the inverse process where branches are coalesced 2. Вопрос 2 A detailed branching history can be shown by: git branch --show git show branch git show-branch git branch show Правильно This does the job 3. Вопрос 3 To examine an earlier version of a file in commit 3888bc981a, do: git show 3888bc981a kernel/sys.c git log 3888bc981a kernel/sys.c git show 3888bc981a:kernel/sys.c git display 3888bc981a:kernel/sys.c Правильно This is correct 4. Вопрос 4 You can list all current branches on the local machine with (Select all answers that apply): git branch --list Правильно This does the job git branch -v Правильно The -v here is for verbose and gives more information than without it git branch Правильно This does the job and is identical to specifying --list 5. Вопрос 5 The command git checkout some_branch: Incorporates changes in some_branch into the current branch Switches to some_branch Gives some information about some_branch Правильно It "checks out" the new branch Diffs 1. Вопрос 1 If there are two branches, br1 and br2, showing all differences between them can be done with: git diff --show br1 br2 git diff br1 br2 Правильно This will show all differences between the branches 2. Вопрос 2 Showing which files have changed between two branches can be done with (Select all answers that apply): git diff --pretty br1 br2 git diff --show br1 br2 git diff --numstat br1 br2 Правильно This is less verbose than --stat git diff --stat br1 br2 Правильно This is more verbose than --numstat Вы выбрали не все правильные ответы 3. Вопрос 3 Showing all differences between the current working tree and the last commit can be done with: git diff --latest git diff --working git diff --clean git diff Правильно Without a branch or commit name, diff shows relationship to the last commit on this branch 4. Вопрос 4 In the command git diff tag1 name2, if tag1 is a tag, name2 can be _________ (Select all answers that apply): another tag Правильно git diff can diff tags, branches and commits a branch name Правильно git diff can diff tags, branches and commits a previous commit identifier Правильно git diff can diff tags, branches and commits 5. Вопрос 5 How can you see the differences in file1 between tag1 and tag2? git diff tag1 file1 tag2 git diff file1 tag1 tag2 git diff tag1 tag2 file1 Правильно This is the correct syntax Merges 1. Вопрос 1 Which procedure does a better job of preserving a project's history? git rebase git merge Правильно git merge preserves the full history and adds to it 2. Вопрос 2 Why might a merge result in problems that do not show conflicts? Select all answers that apply. A merge might affect code in a very different part of the product in a non-obvious way and not receive enough testing Правильно This answer explains itself There may be two different solutions to the same problem which interfere with other Правильно The code might look fine, but the results are problematic It may increase the cost of the product The merge may alienate a developer who was opposed to it 3. Вопрос 3 A git rebase: Is not a legal operation in a public repository Adapts a branch to incorporate the latest changes in another branch without yet merging this branch into the other branch Hides changes so no one can trace where they are coming from Правильно This is the purpose of a rebase 4. Вопрос 4 How would you merge two branches (br1 and br2) into the main branch? git checkout main && git merge br1 br2 git checkout br1 && git merge br2 && git checkout main && git merge br1 git checkout main && git merge br1 && git merge br2 Правильно You can only merge one branch at a time 5. Вопрос 5 What do you do when a merge fails? Abandon all changes desired and start over with a git revert Evaluate the conflict, see what the correct result should be and then fix Find out who is to blame and force them to fix their errors Правильно This is correct Week 3 Managing Local and Remote Repositories 1. Вопрос 1 When you clone a remote repository, you receive: A complete copy, including only the most recent commits of each branch A complete copy, including all branches and their detailed history A read-only version of the repository Правильно Cloning makes a complete copy by definition 2. Вопрос 2 To make a compressed tarball of the most current version of your repository, do: git archive HEAD > myproject.tar.gz git archive | gzip > myproject.tar.gz git archive HEAD | gzip > myproject.tar.gz Правильно This is correct 3. Вопрос 3 Someone's remote branch could be merged into a certain branch on a repository by (Select all answers that apply): Having the person doing a push if and only if that person has commit privileges for the remote repository Правильно This is normal for projects with only a few well coordinated developers as it can be messy if their are conflicting development paths Having the person issue a pull request and then having the maintainer take care of it Правильно This is a normal method 4. Вопрос 4 A bare repository: Is used only for integrity comparison purposes Has no working files and is used only for cloning, fetching and pushing Is naked and thus hidden from public view Правильно 5. Вопрос 5 To make a repository on your machine visible to others across the internet using the git protocol you must: Configure and enable the git daemon service Configure and enable the httpd service (web server) Правильно This serves url's beginning with git:// Using Patches 1. Вопрос 1 To get all patches between your current branch and the master branch, do: git format-patch master git format-patch --all master Правильно This will generate patches since last synced with master 2. Вопрос 2 The best way to form patches for use with git is to: Use git-format-patch Правильно This ensures all formatting is done correctly for git use Work in a text editor while comparing sources Use diff -Nur 3. Вопрос 3 In modern advanced distributed projects, submitting patches through email is: The best procedure, lowest common denominator, since not everyone has git Prohibited Something only used for relatively simple submissions, often to subsystem maintainers Правильно It is just much easier and less error prone to use git itself for larger submissions 4. Вопрос 4 When applying patches: It is a good idea to test first with the --dry-run option It is good to use the --interactive option It is good to use the --force option Правильно It is sensible to test first rather than have to back out a partial success 5. Вопрос 5 Select the true statement: Most modern email clients do not have built-in support for git, so one needs to worry about whitespace, line-wrapping and other potential problems Most modern email clients have built-in support for git, so one need not worry about whitespace, line-wrapping and other potential problems Правильно Email clients are git-ignorant Working with Other Developers (Ungraded) 1. Вопрос 1 Maintaining separate repositories makes sense when (Select all answers that apply): Developers are separated across a large network Правильно There are several situations when maintaining separate repositories makes sense: A developer is working autonomously Developers are separated across a large network There are divergent projects or subareas that are worth developing deeply on their own, with the idea of eventually merging changes that are found to be beneficial to the main project. A developer is working autonomously Правильно There are several situations when maintaining separate repositories makes sense: A developer is working autonomously Developers are separated across a large network There are divergent projects or subareas that are worth developing deeply on their own, with the idea of eventually merging changes that are found to be beneficial to the main project. When developers are part of a local group There are divergent projects or subareas that are worth developing deeply on their own, with the idea of eventually merging changes that are found to be beneficial to the main project Правильно There are several situations when maintaining separate repositories makes sense: A developer is working autonomously Developers are separated across a large network There are divergent projects or subareas that are worth developing deeply on their own, with the idea of eventually merging changes that are found to be beneficial to the main project. 2. Вопрос 2 Which of the following cloning methods is the fastest and cleanest, and recommended to be used whenever supported? 1 / 1 балл http:// ssh:// git:// Правильно 3. Вопрос 3 All patches you submit will succeed. True or False? 1 / 1 балл True False Правильно It is more than possible that one or more of the patches will fail due to conflicting lines of development between the patch sender and receiver. 4. Вопрос 4 It is best practice to publish all your revisions immediately, even if your repository is not committed up-to-date. True or False? 1 / 1 балл True False Правильно Before you publish your revisions, you should first make sure your repository is clean and committed up to date 5. Вопрос 5 Gerrit's architecture is designed to formalize a workflow when you want to have a more dispersed view of the development process (when there are multiple reviewers and the project has some structure for who makes the ultimate decisions). True or False? 1 / 1 балл True False Правильно Advanced Git Interfaces: Gerrit 1. Вопрос 1 Gerrit is: An enhanced method of using git for more complex projects A more advanced replacement for git Правильно Gerrit is built on top of git 2. Вопрос 2 What are some of the advantages of using Gerrit? Select all answers that apply. It introduces a more robust layer of code review by potentially mutliple individuals Правильно This can really help to utilize more eyeballs and talent It can reduce single maintainer bottlenecks Правильно Sometimes an individual maintainer/reviewer cannot work fast enough for many reasons 3. Вопрос 3 Gerrit works best when: There are many changes to commit There is one change per commit Правильно This makes review easier 4. Вопрос 4 With Gerrit, contributors submit their work to: The reviewing layer, rather than fully upstream The upstream and then reviewers pick from there Правильно Use of this layer is a major purpose of Gerrit 5. Вопрос 5 With Gerrit, reviewers: Work only with the contributor layer Work only with the upstream layer Work with both the upstream and contributor layers Правильно Reviewers work directly with contributors and decide when and how to submit upstream 1. What are the main types of Open Source Software (OSS) licenses? Select all answers that apply. Ans: Restrictive Permissive 2. Linux began: Ans: In 1991 with an Internet post by a student in Finland 3. Which method best describes the way Android is developed? Ans: Company-Led 4. Which method best describes the way FreeBSD is developed? Ans: Governing Board 5. Which method best describes the way Linux kernel is developed? Ans: Benevolent Dictatorship 1. The git version control system arose from needs of which project: Ans: The Linux Kernel 2. Which of the following are OSS projects used to construct a graphical user interface (GUI)? Ans: Wayland X Window System KDE GNOME 3. Which of the following are projects emanating from the Free Software Foundation? Ans: gcc glibc gdb bash 4. Which of the following are widespread fully OSS Projects (Select all that apply): Ans: None of the above 5. Which of the following document preparation systems are OSS projects (Select all that apply): Ans: TeX, LaTeX and related versions LibreOffice 1. From a business perspective, use of OSS (Select all answers that apply): Ans: Makes marketing easier as some ingredients are already well-known and trusted Enables use of ingredients from other sources and speeds development 2. OSS is (Select all answers that apply): Ans: Secure or insecure depending on the quality and priorities of the project maintainers, but at least users can judge this by open discussion and code inspection Can be more secure because many developers can easily see the code, look for problems, and mitigate problems when they are discovered 3. For school systems at any level, use of OSS (Select all answers that apply): Ans: Can lower costs by letting older hardware be used Can lower costs by letting low-cost or free software be used 4. School systems can benefit from using OSS because (Select all answers that apply): Ans: Students may learn how to join projects and contribute from an early age or stage in their education As the world's IT infrastructure becomes more and more OSS-based, students will be better prepared to enter the work force especially as developers Students can more easily learn about how things really work as compared to using closed source operating systems and applications 5. Developers working in OSS will: Ans: Will often find it easier to get good jobs because their work will be more open to inspection 1. Continuous Integration (Select all answers that apply): Ans: Speeds up the development process, as builds and tests are fully automated Can speed development, as wrong paths can be discovered before they are pursued for a long time Minimizes regression bugs, since thorough testing is done at every stage before release (i.e. continuously) Can put a strain on developers who have to submit changes constantly Can be costly to set up, as it requires a server and staff and training developers to use properly 2. What is the correct order of the Continuous Integration process stages? Ans: Integration, Delivery and Deployment 3. Which statement is true? Ans: Use of Continuous Integration and revision control methods are independent, but are usually employed together 4. The Linux Kernel Continuous Integration Project was initiated by: Ans: Linaro 5. There are many tooling suites used for Continuous Integration. The most widely used one is: Ans: Jenkins 1. What are some considerations that go into OSS license selection (Select all answers that apply)? Ans: Should all modifications be public (restrictive vs permissive) Policy on patents 2. Which of the following is a "copyleft" license? Ans: GPL 3. FUD stands for: Ans: Fear, Uncertainty and Doubt 4. Select the true statement: Ans: OSS and Closed Source Software can co-exist in a product, but careful analysis should be done to make sure proper boundaries are respected and enforced 5. Select the true statement: Ans: Use of OSS has no predetermined effect on legal costs. It can lower them, since proper license enforcement can be built-in early, or it can raise them by having more people pick at the code if attribution has been sloppy 1. When first getting involved in an OSS project, you should (Select all answers that apply): Ans: Start by helping test and report results Consider what it is you would like to work on, either because it is needed by you, or it just interests you 2. When working on an OSS project, the best strategy is to: Ans: Submit changes one at a time in a sequential manner, even if the full change will not do much until the entire patch series is incorporated 3. When there is someone in the project community that gets abusive or just difficult to deal with, you should (Select all answers that apply): Ans: Actually read what they are saying; even if phrased in a nasty manner, the points might need addressing, and you can respond to them calmly Let established community members moderate the conflict 4. You have worked hard on implementing a new feature for an OSS project and submitted your work. A senior maintainer liked you ideas, but ignored your implementation and substituted their own new one to the same end. You should: Ans: If the other implementation is successful at achieving its purpose, you should accept the result gratefully (after registering your displeasure that rather than reviewing and modifying your work, it was abandoned), and contribute to improving the new implementation as needed 5. On a project mailing list, someone inserts an irrelevant political, religious, or philosophical comment into an otherwise technical discussion and this is at least mildly offensive to you. A good and proper response could be (Select all that apply): Ans: Politely ask the poster to not make such comments. If they counter with more and stronger statements, ask any discussion moderators to quiet the issue offline if needed. Ignore the comment and just answer the technical issues 1. Select the correct statement. GitHub: Ans: Is a private company acquired by Microsoft in 2018 2. Sites that offer services similar to GitHub include (select all that apply): Ans: GitLab GitKraken Launchpad 3. When using a GitHub public repository: Ans: Anyone on the Internet can download the data, but only authorized collaborators can upload information and modifications 4. To use Git, you: Ans: Be on any operating system and version that has Git installed, and almost all do 5. To use GitHub and the other sites that provide repository hosting: Ans: You can work from either a graphical interface or a command line 1. The abbreviation BDFL stands for: Ans: The abbreviation BDFL stands for: 2. The job of a mentor includes: Ans: Teaching contributors how to handle criticism, as well as how to give constructive criticism Finding ways to empower people to give their maximum contribution Training new project contributors in how to submit their work successfully in the right form 3. If a project fails in the sense that it stops moving forward, it is likely because (Select all answers that may apply): Ans: There is insufficient interest in the wider community of developers There are not enough developers contributing Leadership is poor 4. Which statement is true? Ans: A project should have a clear license to begin with. It may possibly make a change later if it really needs to, but that is often non-trivial if there are quite a few contributors 5. Most open source projects fail in the sense that they stagnate and fade away. Is this bad? Ans: It is not bad. Many seeds are planted and only some bloom, and it is difficult to predict which ones. It is always good to encourage a lot of new ideas and methods, and let them compete until the winners emerge. 1. OSS projects should explicitly encourage diversity with respect to (Select all answers that apply): Ans: Sex and gender identity National origin and language Race 2. The majority of OSS projects carry out their discussions in English. Therefore (Select all answers that apply): Ans: One should always speak as clearly as possible, and while not being dull, think about the audience and what they will be familiar with 3. With respect to criticism, an OSS contributor and reviewer should (Select all answers that apply): Ans: Answer thoughtfully and point out where one agrees or disagrees, where changes are accepted or not. Not hold back, it is important to have open and forthright discussion 4. Some one on an OSS mailing list introduces a political aside and perhaps a preference during a technical discussion. Appropriate responses include (Select all correct answers): Ans: Ignore the point and just address the technical issues as needed. Acknowledge the issue but briefly without putting down anyone with differing opinions. Avoid amplifying 5. You propose a new way of doing something, or adding a new feature. Another contributor points out this idea was reject previously. You should (Select all answers that apply): Ans: Study the previous discussion and see whether it applies, including whether or not differences between your ideas and the old ones were not seen Ask whether or not technical abilities have evolved to the point where something that was not feasible can be done today Ask whether the need for this feature has grown; the earlier discussion may have been premature 1.Question 1 In the X Window System: The server handles matters such as display and input devices, while the client can be anywhere and is the running application. 2.Question 2 Which of the following are layers of the graphical system interface? Desktop Manager Display Manager Window Manager 3.Question 3 If you are running a GNOME desktop manager: You can run KDE-based applications most of the time, as long as the underlying libraries have been installed by the distribution 4.Question 4 Which of the following are Desktop Managers? XFCE KDE GNOME 5.Question 5 What are ways you can launch a terminal window on a graphical desktop? Find the "terminal" option in the Application or Favorites menu On many but not all desktops, right click anywhere on the background and click on Open Terminal Hit Alt-F2 and then type in the program name (e.g., gnome-terminal, konsole, xterm etc.) 1.Question 1 In order to install and use Linux: You need a computer or an account in a cloud environment such as AWS, Azure or Google Cloud 2.Question 2 Which of the following are members of the Debian distribution family (Select all answers that apply)? Ubuntu Ubuntu is a member of the Debian family. Linux Mint Linux Mint is a member of the Debian family. 3.Question 3 Which of the following are Enterprise Linux Distributions (Select all answers that apply)? SUSE SUSE is an Enterprise Distribution RHEL Red Hat Enterprise Linux is an Enterprise Distribution, as its name indicates! 4.Question 4 Which of the following are important facilities Linux distributions provide? All are correct Provide updates, upgrades and bug and security fixes to end user systems in a timely and controlled fashion Make sure all the different software on the system works together and is updated at once without conflicts Make it easy to install Linux on a wide variety of hardware platforms Form the connecting bridge between end users and upstream developers, making sure each is aware of the other's situations 5.Question 5 Select all true answers: The term Linux really applies only to the core kernel, not the entire operating system. Linux borrowed heavily from basic UNIX features, but is not actually an implementation of the UNIX operating system. |