Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-06

[Announcement] Patchwrangler

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Hi lists,

Working with the FPC supplied-version of patch.exe on Windows I got tired of fiddling with paths etc when dealing with patches so I wrote patchwrangler: a GUI that loads a patch/diff file, fixes Unix=>DOS (and vice versa) directory separators, and can guess which -p<n> option to pass to patch.exe.

First release available at this mercurial repository: https://bitbucket.org/reiniero/patchwrangler/
source and executable can be downloaded from
https://bitbucket.org/reiniero/patchwrangler/downloads

To do:
- convert dos*nix line endings
- GUI cleanup (merge Dry run and Apply patch button code)
- ??? wishes and feedback, let alone patches welcome ;)

Thanks,
Reinier

Reply by email

Juha Manninen
to Reinier Olislagers
Reinier Olislagers wrote
To do: - convert dos*nix line endings

I think the patch command already does some conversion there, at least on Linux. I never had line ending related problems when applying patches with "patch", but I did have problems when adding whole new files.

- ??? wishes and feedback, let alone patches welcome ;)

Guessing the -p<n> option is good, but even better would be to search the to-be-patched file in case the diff was not made from the project top dir.
At least Lazarus project has so many files that nobody remembers where they all are.
Sometimes I must search for a file using a file browser, then cd to the dir then then apply the patch.

Juha

Reply by email

Bart
to Juha Manninen
Juha Manninen wrote 8 lines
On 6/2/13, Reinier Olislagers wrote: > To do: > - convert dos*nix line endings I think the patch command already does some conversion there, at least on Linux. I never had line ending related problems when applying patches with "patch", but I did have problems when adding whole new files.

On Windows patch requires CrLf line endings.
In order to get patch to work on Windows I wrote a NativeEndOfLine converter. Before that I had to load every patch file in mte text editor, modify it (add a spece somewhere) and save it (which converted it ot native EOL).

Bart

Reply by email

Reinier Olislagers
to Bart
Bart wrote 12 lines
On 6/2/13, Juha Manninen wrote: > On 6/2/13, Reinier Olislagers wrote: >> To do: >> - convert dos*nix line endings > > I think the patch command already does some conversion there, at least on > Linux. > I never had line ending related problems when applying patches with > "patch", but I did have problems when adding whole new files. On Windows patch requires CrLf line endings.

Patchwrangler seems to cover this already, just tested it. @Juha: raised issue 2 for you about finding patch files somewhere below the Laz directory:
https://bitbucket.org/reiniero/patchwrangler/issue/2/search-for-subdirectories-files-if-patch

Reply by email

Reinier Olislagers
to Juha Manninen: I think the patch command already does some conversion there, at least on Linux. I never…
Juha Manninen wrote 6 lines
On 6/2/13, Reinier Olislagers wrote: > - ??? wishes and feedback, let alone patches welcome ;) Guessing the -p<n> option is good, but even better would be to search the to-be-patched file in case the diff was not made from the project top dir.

Done.

Win32 executable download:
https://bitbucket.org/reiniero/patchwrangler/downloads MIT licensed source available there as well.

In the pipeline: command line operation with options like --batch: never show GUI; abort if patch cannot be applied --reporoot: root directory under which the patch should be applied (somewhere - using the same heuristic search if necessary as in the GUI) --patch: location of patch.exe (needed if not in path)

Regards,
Reinier

Reply by email

Reinier Olislagers
to Juha Manninen: I think the patch command already does some conversion there, at least on Linux. I never…
Juha Manninen wrote 8 lines
On 6/2/13, Reinier Olislagers wrote: Guessing the -p<n> option is good, but even better would be to search the to-be-patched file in case the diff was not made from the project top dir. At least Lazarus project has so many files that nobody remembers where they all are. Sometimes I must search for a file using a file browser, then cd to the dir then then apply the patch.

This now works well on Windows.

Updated file searching capability thanks to Ludo Brand's contributions. Should be quite a bit faster and gives you a GUI to select which directory to use if there are multiple candidates.

See announcement on forum for more details.

Reply by email