Pl/FGAddon: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 616: Line 616:
=== Binarny diff ===
=== Binarny diff ===


{{warning|The incorrect setting or absence of the mime-type property on a binary file will result in a binary diff.}}
{{warning|Nieprawidłowe ustawienie lub brak właściwości mime-type w pliku binarnym spowoduje diff binarny.}}


When looking at the output of <code>svn diff</code> (or <code>git diff</code> if you are using git-svn) as well as when reading messages from the [[#FGAddon commitlog mailing list|FGAddon commitlog mailing list]], you may see a large number of unrecognisable characters. This is the result of what is known as a binary diff, showing the binary file differences as if it were text. Although this is not a issue for the operation of the repository, the situation is an aesthetic problem which makes it more difficult to perform a review of the changes.
Patrząc na wyjście <code>svn diff</code> (lub <code>git diff</code>, jeśli używasz git-svn), a także podczas czytania wiadomości z  [[#Lista_mailingowa_commitlog|listy mailingowej commitlog]], możesz zobaczyć dużą liczbę nierozpoznawalnych znaków. Jest to wynik tak zwanej różnicy binarnej, która pokazuje różnice w plikach binarnych tak, jakby były tekstem. Chociaż nie stanowi to problemu dla działania repozytorium, jest to problem estetyczny, który utrudnia przegląd zmian.


To fix the problem, firstly the binary files with the <code>svn:mime-type</code> property missing need to be identifiedThe following subversion command can be used:
Aby rozwiązać problem, należy najpierw zidentyfikować pliki binarne z brakującą właściwością <code>svn:mime-type</code>.  Możesz użyć następującego polecenia subversion:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
svn propget svn:mime-type <file_name>
svn propget svn:mime-type <file_name>
</syntaxhighlight>
</syntaxhighlight>


As it can be tedious checking each file individually, the following Python script simplifies and automates the process to identify all binary files with a mime-type issue:
Ponieważ sprawdzanie każdego pliku z osobna może być żmudne, poniższy skrypt Pythona upraszcza i automatyzuje proces identyfikacji wszystkich plików binarnych z błędem typu MIME:


{{collapsible script
{{collapsible script
| type  = Python 2/3 script
| type  = Skrypt Python 2/3
| title  = Find binary files with no <code>svn:mime-type</code> property set.
| title  = Znajduje pliki binarne bez ustawionej właściwości <code>svn:mime-type</code>.
| intro  = The following script is based on blacklisting text filesHence false positives are to be expected, and the blacklists can be expanded as needed.
| intro  = Poniższy skrypt bazuje na czarnych listach plików tekstowychW związku z tym należy spodziewać się wyników fałszywie dodatnich, a czarne listy można rozszerzać w razie potrzeby.
| lang  = python
| lang  = python
| script =
| script =
Line 731: Line 731:
}}
}}


==== Fixing the problem ====
==== Naprawianie problemu ====


As [[#Subversion_properties|git-svn cannot set or change]] the <code>svn:mime-type</code> property, a [[#Repository_checkout|svn checkout copy]] of the aircraft is requiredThe property can then be set to the default Subversion binary mime-type with:
Ponieważ [[#Właściwości_Subversion|git-svn nie może ustawić ani zmienić]] właściwości <code>svn:mime-type</code>, wymagane jest [[#Pobranie_repozytorium|pobranie kopii]] statku powietrznego za pomocą SVNWłaściwość można następnie ustawić na domyślny binarny typ MIME za pomocą:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
svn propset svn:mime-type "application/octet-stream" <file_name>
svn propset svn:mime-type "application/octet-stream" <file_name>
</syntaxhighlight>
</syntaxhighlight>


Alternatively, the following set of shell commands can be used to automate the process:
Alternatywnie, poniższy zestaw poleceń powłoki może być użyty do zautomatyzowania procesu:
{{collapsible script
{{collapsible script
| type  = Shell commands
| type  = Polecenia powłoki
| title  = Set specific <code>svn:mime-type</code> values on a set of known binary files.
| title  = Ustawienie określonych wartości <code>svn:mime-type</code> dla zestawu znanych plików binarnych.
| intro = These shell commands will work on GNU/Linux or Mac OS X systems (or on Windows if using cygwin, or if a find command line tool is installed).  The list of file types here are those most commonly found in FGAddon.  To set the property on a list of binary files, type (or copy and paste):
| intro = Te polecenia powłoki będą działać w systemach GNU/Linux lub macOS (lub w systemie Windows, jeśli używasz cygwina lub jeśli zainstalowane jest narzędzie wiersza poleceń find).  Lista typów plików zawiera te najczęściej spotykane w FGAddon.  Aby ustawić właściwość na liście plików binarnych, wpisz (lub skopiuj i wklej):
| lang  = bash
| lang  = bash
| script =
| script =
1,361

edits

Navigation menu