<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.vifm.info/index.php?action=history&amp;feed=atom&amp;title=Local_repository_configuration</id>
	<title>Local repository configuration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.vifm.info/index.php?action=history&amp;feed=atom&amp;title=Local_repository_configuration"/>
	<link rel="alternate" type="text/html" href="https://wiki.vifm.info/index.php?title=Local_repository_configuration&amp;action=history"/>
	<updated>2026-07-08T02:55:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.vifm.info/index.php?title=Local_repository_configuration&amp;diff=369&amp;oldid=prev</id>
		<title>Xaizek: Build tests less parallel</title>
		<link rel="alternate" type="text/html" href="https://wiki.vifm.info/index.php?title=Local_repository_configuration&amp;diff=369&amp;oldid=prev"/>
		<updated>2015-08-16T18:34:22Z</updated>

		<summary type="html">&lt;p&gt;Build tests less parallel&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:34, 16 August 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot; &gt;Line 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 101:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;if ! git diff --quiet HEAD; then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;if ! git diff --quiet HEAD; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     # run tests using staged changes only&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     # run tests using staged changes only&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     make --directory tests/ --no-print-directory --jobs&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nice ionice &lt;/ins&gt;make --directory tests/ --no-print-directory --jobs &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;4&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     RESULT=&amp;quot;$?&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     RESULT=&amp;quot;$?&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;else&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Xaizek</name></author>
	</entry>
	<entry>
		<id>https://wiki.vifm.info/index.php?title=Local_repository_configuration&amp;diff=363&amp;oldid=prev</id>
		<title>Xaizek: Initial version of the page</title>
		<link rel="alternate" type="text/html" href="https://wiki.vifm.info/index.php?title=Local_repository_configuration&amp;diff=363&amp;oldid=prev"/>
		<updated>2015-08-09T13:45:14Z</updated>

		<summary type="html">&lt;p&gt;Initial version of the page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Please install the following script as &amp;lt;code&amp;gt;.git/hooks/pre-commit&amp;lt;/code&amp;gt; (don't forget to do &amp;lt;code&amp;gt;chmod +x&amp;lt;/code&amp;gt; on it) that will perform several checks on changes before they are committed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Hook script to verify what is about to be committed.&lt;br /&gt;
# Called by &amp;quot;git commit&amp;quot; with no arguments.  The hook should&lt;br /&gt;
# exit with non-zero status after issuing an appropriate message if&lt;br /&gt;
# it wants to stop the commit.&lt;br /&gt;
&lt;br /&gt;
# This hook:&lt;br /&gt;
#  * checks for whitespace errors&lt;br /&gt;
#  * checks for bad characters&lt;br /&gt;
#  * runs tests on changes that are about to be committed (other modifications&lt;br /&gt;
#    except for untracked files are stashed for this)&lt;br /&gt;
&lt;br /&gt;
if git rev-parse --verify HEAD &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; then&lt;br /&gt;
    against=HEAD&lt;br /&gt;
else&lt;br /&gt;
    # Initial commit: diff against an empty tree object&lt;br /&gt;
    against=4b825dc642cb6eb9a060e54bf8d69288fbee4904&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# If you want to allow non-ascii filenames set this variable to true.&lt;br /&gt;
allownonascii=$(git config hooks.allownonascii)&lt;br /&gt;
&lt;br /&gt;
# Cross platform projects tend to avoid non-ascii filenames; prevent&lt;br /&gt;
# them from being added to the repository. We exploit the fact that the&lt;br /&gt;
# printable range starts at the space character and ends with tilde.&lt;br /&gt;
if [ &amp;quot;$allownonascii&amp;quot; != &amp;quot;true&amp;quot; ] &amp;amp;&amp;amp;&lt;br /&gt;
    # Note that the use of brackets around a tr range is ok here, (it's&lt;br /&gt;
    # even required, for portability to Solaris 10's /usr/bin/tr), since&lt;br /&gt;
    # the square bracket bytes happen to fall in the designated range.&lt;br /&gt;
    test &amp;quot;$(git diff --cached --name-only --diff-filter=A -z $against |&lt;br /&gt;
      LC_ALL=C tr -d '[ -~]\0')&amp;quot;&lt;br /&gt;
then&lt;br /&gt;
    echo &amp;quot;Error: Attempt to add a non-ascii file name.&amp;quot;&lt;br /&gt;
    echo&lt;br /&gt;
    echo &amp;quot;This can cause problems if you want to work&amp;quot;&lt;br /&gt;
    echo &amp;quot;with people on other platforms.&amp;quot;&lt;br /&gt;
    echo&lt;br /&gt;
    echo &amp;quot;To be portable it is advisable to rename the file ...&amp;quot;&lt;br /&gt;
    echo&lt;br /&gt;
    echo &amp;quot;If you know what you are doing you can disable this&amp;quot;&lt;br /&gt;
    echo &amp;quot;check using:&amp;quot;&lt;br /&gt;
    echo&lt;br /&gt;
    echo &amp;quot;  git config hooks.allownonascii true&amp;quot;&lt;br /&gt;
    echo&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
function pop_stashed()&lt;br /&gt;
{&lt;br /&gt;
    # pop stashed changes if working directory wasn't clean&lt;br /&gt;
    if [ -z &amp;quot;$DIRTY&amp;quot; ]; then&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    git reset --hard HEAD&lt;br /&gt;
    local skipped=&amp;quot;$(git ls-files -t | grep ^S | cut -d' ' -f2-)&amp;quot;&lt;br /&gt;
    git stash pop --quiet --index&lt;br /&gt;
&lt;br /&gt;
    while read file; do&lt;br /&gt;
        git update-index --skip-worktree &amp;quot;$file&amp;quot;&lt;br /&gt;
    done &amp;lt;&amp;lt;&amp;lt; &amp;quot;$skipped&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function check_odd_whitespace()&lt;br /&gt;
{&lt;br /&gt;
    # check for odd whitespace&lt;br /&gt;
    git diff-index --check --color $1 $against --&lt;br /&gt;
    local check_exit_code=&amp;quot;$?&amp;quot;&lt;br /&gt;
    if [ &amp;quot;$check_exit_code&amp;quot; -ne &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\e[1;31m&amp;quot;&amp;quot;Your changes introduce whitespace errors&amp;quot; &amp;quot;\e[7;0m&amp;quot;&lt;br /&gt;
        if [[ -z &amp;quot;$ALLOW_WHITESPACE_ERRORS&amp;quot; ]]; then&lt;br /&gt;
            exit $check_exit_code&lt;br /&gt;
        fi&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function file_changed()&lt;br /&gt;
{&lt;br /&gt;
    ! git diff --quiet --cached &amp;quot;$1&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# check for odd whitespace before running tests&lt;br /&gt;
check_odd_whitespace --cached&lt;br /&gt;
&lt;br /&gt;
# determine working tree status&lt;br /&gt;
git diff --quiet&lt;br /&gt;
DIRTY=`[ $? != 0 ] &amp;amp;&amp;amp; echo '*'`&lt;br /&gt;
&lt;br /&gt;
# stash not staged for commit changes&lt;br /&gt;
if [ &amp;quot;x$DIRTY&amp;quot; != &amp;quot;x&amp;quot; ]; then&lt;br /&gt;
    if ! git stash save --keep-index; then&lt;br /&gt;
        return 1&lt;br /&gt;
    fi&lt;br /&gt;
    trap pop_stashed EXIT&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if ! git diff --quiet HEAD; then&lt;br /&gt;
    # run tests using staged changes only&lt;br /&gt;
    make --directory tests/ --no-print-directory --jobs&lt;br /&gt;
    RESULT=&amp;quot;$?&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    RESULT=&amp;quot;0&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# check for odd whitespace after running tests&lt;br /&gt;
check_odd_whitespace&lt;br /&gt;
&lt;br /&gt;
# stashed changes (if any) are automatically restored by EXIT trap handler&lt;br /&gt;
&lt;br /&gt;
# return result of running tests&lt;br /&gt;
exit $RESULT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xaizek</name></author>
	</entry>
</feed>