Pl/FGAddon: Difference between revisions

Jump to navigation Jump to search
Line 494: Line 494:
</syntaxhighlight>
</syntaxhighlight>


=== Commit blocking by pre-commit hooks ===
=== Blokowanie zatwierdzeń przez pre-commit hook ===


Sometimes when committing to FGAddon, the commit will be blocked the following will be printed out:
Czasami podczas zatwierdzania w FGAddon, zatwierdzenie zostanie zablokowane i zostanie wypisana następująca informacja:
<pre>
<pre>
svn: E165001: Commit failed (details follow):
svn: E165001: Commit failed (details follow):
Line 502: Line 502:
</pre>
</pre>


This is due to the presence of two repository pre-commit hook scripts which check the quality of the commit, blocking it if a text file is set to a binary file mime-type or if the executable flag is setThese scripts are simply to protect the repository and to keep it clean.
Wynika to z obecności dwóch skryptów pre-commit hook repozytorium, które sprawdzają jakość zatwierdzenia, blokując je, jeśli plik tekstowy jest ustawiony na typ mime pliku binarnego lub jeśli ustawiona jest flaga wykonywalnaSkrypty te mają po prostu chronić repozytorium i utrzymywać je w czystości.


==== Problemy z mime-type ====
==== Problemy z mime-type ====


Sometimes when attempting to commit files to FGAddon using the SVN tools, the commit will be blocked with the following message:
Czasami podczas próby zatwierdzenia plików do FGAddon przy użyciu narzędzi SVN, zatwierdzenie zostanie zablokowane z następującym komunikatem:
<pre>
<pre>
Sending        dash-set.xml
Sending        dash-set.xml
Line 534: Line 534:
</pre>
</pre>


Despite messages about adding or sending files, no change will have occurred in the FGAddon repository. This message is created by a repository pre-commit hook script which checks if the Subversion <code>svn:mime-type</code> property is set on a list of known text files and, if the mime-type is set to a binary format, the commit is blocked. The reason for this block is to protect the repository. Newer SVN clients rely on a 3rd party library known as libmagic which will detect the aircraft XML files as the binary mime-type of <code>application/xml</code>. The result is that the XML files are treated as binary files in the repository. This behaviour is completely undesirable, as changes cannot be followed on the [[#FGAddon commitlog mailing list|flightgear-fgaddon-commitlogs mailing list]] or in the repository history, and the size of the commits become orders of magnitude larger. Therefore this buggy behaviour has been blocked for the protection of the FlightGear project. To remove the problem, follow the instructions in the message and, using the command line tools, type:
Pomimo komunikatów o dodaniu lub wysłaniu plików, w repozytorium FGAddon nie zajdą żadne zmiany. Ta wiadomość jest tworzona przez skrypt pre-commit hook repozytorium, który sprawdza, czy właściwość Subversion <code>svn:mime-type</code> jest ustawiona na liście znanych plików tekstowych. Jeśli typ MIME jest ustawiony na format binarny, to zatwierdzenie jest blokowane. Powodem tego bloku jest ochrona repozytorium. Nowsi klienci SVN korzystają z biblioteki trzeciej znanej jako libmagic, która wykrywa pliki XML samolotu jako pliki typu MIME binarnego <code>application/xml</code>. W rezultacie pliki XML są traktowane w repozytorium jako pliki binarne. Takie zachowanie jest całkowicie niepożądane, ponieważ zmian nie można śledzić na [[#FGAddon commitlog mailing list|liście mailingowej commitlogs]] ani w historii repozytorium, a rozmiar zatwierdzeń staje się o rząd wielkości większy. Dlatego to błędne zachowanie zostało zablokowane w celu ochrony projektu FlightGear. Aby usunąć problem, postępuj zgodnie z instrukcjami zawartymi w komunikacie i korzystając z narzędzi wiersza poleceń wpisz:
 
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
svn propdel svn:mime-type <file_name>
svn propdel svn:mime-type <file_name>
</syntaxhighlight>
</syntaxhighlight>


Repeat this for each text file listed in the error message. Then commit again, using the commit message saved in the <code>svn-commit.tmp</code> file. The message file name will be reported in the commit failure message, but check its contents first:
Powtórz tę czynność dla każdego pliku tekstowego wymienionego w komunikacie o błędzie. Następnie zatwierdź ponownie, korzystając z komunikatu zatwierdzenia zapisanego w pliku <code>svn-commit.tmp</code>. Nazwa pliku komunikatu zostanie wyświetlona w komunikacie o niepowodzeniu zatwierdzenia, ale najpierw sprawdź jego zawartość:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cat svn-commit.tmp
cat svn-commit.tmp
</syntaxhighlight>
</syntaxhighlight>


And reperform the commit:
I ponownie wykonaj zatwierdzenie:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
svn ci -F svn-commit.tmp
svn ci -F svn-commit.tmp
</syntaxhighlight>
</syntaxhighlight>


===== Subversion config file =====
===== Plik konfiguracyjny Subversion =====


The automatic property setting of <code>svn:mime-type</code> can be controlled by modifying the Subversion <code>config</code> file. Firstly in the <code>[miscellany]</code> section, make sure that the auto-properties are turned on:
Automatyczne ustawienie właściwości <code>svn:mime-type</code> może być kontrolowane poprzez modyfikację pliku <code>config</code> Subversion. Najpierw w sekcji <code>[miscellany]</code> upewnij się, że właściwości automatyczne są włączone:
<syntaxhighlight>
<syntaxhighlight>
enable-auto-props = yes
enable-auto-props = yes
</syntaxhighlight>
</syntaxhighlight>


Then in the <code>[auto-props]</code> section, add:
Następnie w sekcji <code>[auto-props]</code> dodaj:
<syntaxhighlight>
<syntaxhighlight>
*.ac = svn:mime-type=text/plain
*.ac = svn:mime-type=text/plain
Line 571: Line 572:
</syntaxhighlight>
</syntaxhighlight>


These are all the text files that the hook script will check that the mime-type is set to a text format, though new text files will likely be added in the future. These additions can either be to the user configuration file located at <code>~/.subversion/config</code> (or <code>%USERPROFILE%\AppData\Roaming\Subversion\config</code> in Windows) or, if a user configuration file is not set, to the global configuration file at <code>/etc/subversion/config</code> (or <code>%APPDATA%\Subversion\config</code> in Windows).
Te wszystkie pliki tekstowe, skrypt przechwytujący sprawdzi, czy typ MIME jest ustawiony na format tekstowy, chociaż w przyszłości prawdopodobnie zostaną dodane nowe pliki tekstowe. Te zmiany można zapisać w pliku konfiguracyjnym użytkownika znajdującym się w <code>~/.subversion/config</code> (lub <code>%USERPROFILE%\AppData\Roaming\Subversion\config</code> w systemie Windows) lub jeśli plik konfiguracyjny użytkownika nie jest ustawiony, to można użyć globalnego pliku konfiguracyjnego w katalogu <code>/etc/subversion/config</code> (lub <code>%APPDATA%\Subversion\config</code> w systemie Windows).


==== Flaga wykonywania ====
==== Flaga wykonywalności ====


Another blocking message when attempting to commit files to FGAddon using the SVN tools is:
Kolejnym komunikatem blokującym podczas próby zatwierdzenia plików do FGAddon przy użyciu narzędzi SVN jest:
<pre>
<pre>
Adding        dash-set.xml
Adding        dash-set.xml
Line 598: Line 599:
</pre>
</pre>


This will probably only be seen on Mac OS X and GNU/Linux systems. This message is printed by a pre-commit repository hook script that checks if the Subversion <code>svn:executable</code> property is set and, if so, the commit is blocked. This is a security measure, as no aircraft files should be executable. To remove the problem, follow the instructions in the message and, using the command line tools, type:
Prawdopodobnie będzie to widoczne tylko w systemach macOS i GNU/Linux. Ta wiadomość jest wyświetlana przez skrypt pre-commit przed zatwierdzeniem, który sprawdza, czy właściwość Subversion <code>svn:executable</code> jest ustawiona, jeśli tak, zatwierdzenie jest blokowane. Jest to środek bezpieczeństwa, ponieważ żadne pliki statku powietrznego nie powinny być wykonywalne. Aby usunąć problem, postępuj zgodnie z instrukcjami zawartymi w komunikacie i korzystając z narzędzi wiersza poleceń wpisz:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
svn propdel svn:executable -R
svn propdel svn:executable -R
</syntaxhighlight>
</syntaxhighlight>


Then commit again, using the commit message saved in the <code>svn-commit.tmp</code> fileThe message file name will be reported in the commit failure message, but check its contents first:
Następnie zatwierdź ponownie, używając komunikatu zatwierdzenia zapisanego w pliku <code>svn-commit.tmp</code>.  Nazwa pliku komunikatu zostanie zgłoszona w komunikacie o niepowodzeniu zatwierdzenia, ale najpierw sprawdź jego zawartość:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cat svn-commit.tmp
cat svn-commit.tmp
</syntaxhighlight>
</syntaxhighlight>


And the reperform the commit:
I ponownie wykonaj zatwierdzenie:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
svn ci -F svn-commit.tmp
svn ci -F svn-commit.tmp
1,361

edits

Navigation menu