Git
Português (Brasil) ▾Topics ▾Latest version ▾ git-patch-id last updated in 2.39.0

NOME

git-patch-id - Calcula o ID exclusivo de um patch

RESUMO

git patch-id [--stable | --unstable | --verbatim]

DESCRIÇÃO

Carregue um patch da entrada padrão e calcule o ID para ele.

A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with line numbers ignored. As such, it’s "reasonably stable", but at the same time also reasonably unique, i.e., two patches that have the same "patch ID" are almost guaranteed to be the same thing.

O principal caso de uso para este comando é procurar por commits possivelmente duplicados.

When dealing with git diff-tree output, it takes advantage of the fact that the patch is prefixed with the object name of the commit, and outputs two 40-byte hexadecimal strings. The first string is the patch ID, and the second string is the commit ID. This can be used to make a mapping from patch ID to commit ID.

OPÇÕES

--verbatim

Calcule o patch-id da entrada conforme é fornecido, não retire nenhum espaço em branco.

Este é o padrão caso `patchid.verbatim` seja verdadeiro.
--stable

Use uma soma "stable" (estável) de hashes como o ID do patch. Com esta opção:

  • Reordering file diffs that make up a patch does not affect the ID. In particular, two patches produced by comparing the same two trees with two different settings for "-O<orderfile>" result in the same patch ID signature, thereby allowing the computed result to be used as a key to index some meta-information about the change between the two trees;

  • O resultado é diferente do valor produzido pelo git 1.9 e mais antigo ou produzido quando um hash "instável" (consulte --unstable abaixo) é configurado - mesmo quando utilizado com um diff gerado obtido sem o uso de "-O<ordem-do-arquivo>", tornando, assim, os bancos de dados existentes armazenando esses IDs "instáveis" ou os históricos com correções inúteis.

  • Todos os espaços em branco dentro do patch são ignorados e não afetam o id.

    Esta é a predefinição caso o `patchid.stable` estiver definido como 'true'.
--unstable

Use an "unstable" hash as the patch ID. With this option, the result produced is compatible with the patch-id value produced by git 1.9 and older and whitespace is ignored. Users with pre-existing databases storing patch-ids produced by git 1.9 and older (who do not deal with reordered patches) may want to use this option.

Esta é a predefinição.

GIT

Parte do conjunto git[1]

scroll-to-top