From: Stas <stas.grumbler@gmail.com> To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org> Subject: Re: [sisyphus] Программа для преобразования patch-файла Date: Tue, 18 Oct 2016 16:56:56 +0500 Message-ID: <58060E08.3070302@gmail.com> (raw) In-Reply-To: <CABUeJrQ68Eh9tB2wH_L_yUORA0zWGNDkx9zaGLzL50us6yQLMg@mail.gmail.com> On 18.10.2016 14:23, Aleksey Birukov wrote: > Существует ли программа преобразовывает patch файл в обратный? IMHO она не имеет смысла, поскольку pathc умеет как применять, так и откатывать дифф. RTFM: man patch > -R or --reverse > Assume that this patch was created with the old and new > files swapped. (Yes, I'm afraid that does happen occasionally, human > nature being what it is.) patch > attempts to swap each hunk around before applying it. > Rejects come out in the swapped format. The -R option does not work > with ed diff scripts because there is > too little information to reconstruct the reverse operation. > > If the first hunk of a patch fails, patch reverses the hunk > to see if it can be applied that way. If it can, you are asked if you > want to have the -R option > set. If it can't, the patch continues to be applied > normally. (Note: this method cannot detect a reversed patch if it is > a normal diff and if the first command > is an append (i.e. it should have been a delete) since > appends always succeed, due to the fact that a null context matches > anywhere. Luckily, most patches add > or change lines rather than delete them, so most reversed > normal diffs begin with a delete, which fails, triggering the heuristic.) -- Станислав Дёгтев Служба "Ваш админ" Мои контакты: - jabber: grumbler@grumbler.org - email: stas.grumbler@gmail.com и stas@vashadmin.su - телефоны в Е-бурге +79045430461 и +79222112259
prev parent reply other threads:[~2016-10-18 11:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-10-18 9:56 ` Alexey Gladkov 2016-10-18 11:56 ` Stas [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=58060E08.3070302@gmail.com \ --to=stas.grumbler@gmail.com \ --cc=sisyphus@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \ sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru public-inbox-index sisyphus Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sisyphus AGPL code for this site: git clone https://public-inbox.org/public-inbox.git