---
name: "podiff"
section: "1"
platform: "linux"
package: "podiff"
version: "1.4-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/podiff"
---

# podiff(1)

compare textual information in two PO files

## NAME

podiff - compare textual information in two PO files

## SYNOPSIS

**podiff** \[**OPTIONS**\] *FILE1* *FILE2*\
 **podiff** \[**OPTIONS**\] *PATH* *OLD-FILE* *OLD-HEX* *OLD-MODE* *NEW-FILE* *NEW-HEX* *NEW-MODE*\
 **podiff -t** \[**OPTIONS**\] *FILE*\
 **podiff**\[**-vh**\]

## DESCRIPTION

The **podiff** utility finds differences in translatable strings and translations between two PO files or between two revisions of the same file.  It uses [**diff**(1)](/diff/1.md) to generate the output.  Before comparing, it eliminates all comments and multiple empty lines, sorts the two files by their **msgid** and reformats all textual strings in a uniform manner.  The utility is intended to help translators obtain meaningful information about changes they do to PO files.

When supplied two non-optional arguments **podiff** acts as a standalone program and outputs differences between the two PO files.  Its exit code is 1 if the two files differ and 0 otherwise.

When given 7 arguments (second case above), **podiff** compares  *OLD-FILE* and *NEW-FILE*. This mode is intended for use as a [**git**(1)](/git/1.md) external diff utility (see *GIT\_EXTERNAL\_DIFF* in [**git**(1)](/git/1.md) and **Generating diff text** in [**gitattributes**(5)](/gitattributes/5.md)). In this mode its exit code is always 0, except if some errors occur. See the **EXAMPLE** section below.

The **podiff** utility understand the following command line options:

- **-d** *CMD*

  Use *CMD* as a **diff** utility.

- **-D** *OPTION*

  Pass *OPTION* as an option to the diff utility.

- **-f**

  Ignore fuzzy translations.

- **-k**

  Keep user comments on output.

- **-L**

  External **diff** understands the **-L** option.  If this option is given,  **podiff** will pass two additional options to  **diff**: **-La/***FILE* **-Lb/***FILE*, where *FILE* is the pathname of the file being diff'ed.

- **-w** *NUM*

  Limit output width to *NUM* columns (see **BUGS** below, though).

- **-t**

  Test mode.  In this mode, **podiff** takes a single file name as its argument and acts as a preprocessor for this file, producing its normalized version on the standard output.  This mode is intended for debugging.

- **-h**

  Prints a terse usage summary.

- **-v**

  Prints program version and licence information.

## RETURN VALUE

In standalone mode (2 arguments), the return code is 0 if the two files don't differ and 1 otherwise.

In Git mode, the return code is 0 unless errors occur.

The return code is 2 if an invalid command line option or invalid number of arguments is given.

## EXAMPLE

The following example shows how to use **podiff** as an external diff utility in [**git**(1)](/git/1.md). The system **diff** utility will be passed the **-u** and two **-L** options.

First, add the following section to the **.git/config** file:

```
[diff "podiff"]
        command = /usr/bin/podiff -D-u -L
```

Next, to the **.gitattributes** file in the directory with your PO files, add the following line:

```
*.po    diff=podiff
```

## SEE ALSO

[**diff**(1)](/diff/1.md), [**git**(1)](/git/1.md), [**gitattributes**(5)](/gitattributes/5.md).

## BUGS

The **-w** option actually operates on **bytes**, not characters, therefore actual output width can be less than its argument.

## AUTHORS

Sergey Poznyakoff

## BUG REPORTS

Report bugs to \<gray@gnu.org.ua\>.

## COPYRIGHT

Copyright © 2011--2020 Sergey Poznyakoff\
 License GPLv3+: GNU GPL version 3 or later \<http://gnu.org/licenses/gpl.html\>\
 This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
