Git
Português (Brasil) ▾Topics ▾Latest version ▾ git-annotate last updated in 2.41.0

NOME

git-annotate - Anote linhas do arquivo com as informações do commit

RESUMO

git annotate [<opções>] [<opções-da-revisão>] [<revisão>] [--] <arquivo>

DESCRIÇÃO

Anota cada linha no arquivo informado com as informações do commit que introduziu a linha. Anota opcionalmente numa determinada revisão.

A única diferença entre esse comando e o git-blame[1] é que eles utilizam formatos de saída ligeiramente diferentes, este comando existe apenas para a compatibilidade com as versões anteriores, visando a compatibilidade dos scripts já existentes e para fornecer um nome do comando mais familiar para as pessoas vindas de outros sistemas SCM.

OPÇÕES

-b

Show blank SHA-1 for boundary commits. This can also be controlled via the blame.blankBoundary config option.

--root

Do not treat root commits as boundaries. This can also be controlled via the blame.showRoot config option.

--show-stats

Inclui estatísticas adicionais no fim da saída do comando blame.

-L <inicio>,<fim>
-L :<funcname>

Annotate only the line range given by <start>,<end>, or by the function name regex <funcname>. May be specified multiple times. Overlapping ranges are allowed.

<inicio> e <fim> são opcionais. -L <inicio> ou -L <inicio>, abrange do <inicio> para o final do arquivo. -L ,<fim> abrange do começo ao <fim>.

<inicio> e <fim> podem assumir uma destas formas:

  • número

    Caso <inicio> ou <fim> seja um número, ele especifica um número de linha absoluto (as linhas contam a partir do 1).

  • /regex/

    This form will use the first line matching the given POSIX regex. If <start> is a regex, it will search from the end of the previous -L range, if any, otherwise from the start of file. If <start> is ^/regex/, it will search from the start of file. If <end> is a regex, it will search starting at the line given by <start>.

  • +offset ou -offset

    Válido apenas para <fim> que definirá uma quantidade de linhas antes ou depois da linha utilizada por <inicio>.

Caso :<funcname> seja informado no lugar do <inicio> e <fim>, é uma expressão regular que indica o intervalo da primeira <funcname> que coincida com <funcname> até a próxima linha funcname. :<funcname> pesquisa no final do intervalo -L anterior, se houver, caso contrário, a pesquisa ocorrerá desde o início do arquivo. ^:<funcname> pesquisa desde o início do arquivo. Os nomes das funções são determinados da mesma maneira que o comando git diff lida com os pedaços dos cabeçalhos do patch (consulte Definindo um cabeçalho personalizado do hunk em gitattributes[5]).

-l

Exibe o rev longo (Predefinição: desligado).

-t

Exibe o registro de data e hora em formato bruto (Predefinição: desligado).

-S <revs-file>

Utilize as revisões do arquivo-revs no lugar de chamar git-rev-list[1].

--reverse <rev>..<rev>

Walk history forward instead of backward. Instead of showing the revision in which a line appeared, this shows the last revision in which a line has existed. This requires a range of revision like START..END where the path to blame exists in START. git blame --reverse START is taken as git blame --reverse START..HEAD for convenience.

--first-parent

Siga apenas o primeiro commit da origem ao ver um commit de mesclagem. Essa opção pode ser usada para determinar quando uma linha foi incorporado em um determinado ramo em vez da sua introdução no histórico geral.

-p
--porcelain

Exiba num formato designado para o consumo de uma máquina.

--line-porcelain

Show the porcelain format, but output commit information for each line, not just the first time a commit is referenced. Implies --porcelain.

--incremental

Exiba o resultado incrementadamente num formado designado para o consumo de uma máquina.

--encoding=<codificação>

Defina a codificação a ser utilizada para gerar os nomes dos autores e do resumo dos commits. Definindo como none torna a saída "blame" em dados sem conversão. Para mais informações, consulte a discussão sobre codificação na página do manual git-log[1].

--contents <arquivo>

Anote usando o conteúdo do arquivo nomeado, iniciando em <rev> caso seja definido, caso contrário, HEAD. Você pode usar - para fazer o comando ler a partir da entrada padrão para dentro do arquivo.

--date <formato>

Especifica o formato utilizado para gerar as datas. Caso --date não seja utilizado, o valor da variável de configuração blame.date será utilizado. Caso a variável de configuração blame.date também não esteja definida, o formato ISO será utilizado. Para ver quais são os valores compatíveis, consulte a discussão da opção --date em git-log[1].

--[no-]progress

É predefinido que a condição do progresso seja relatado no fluxo de erros padrão quando estiver conectado num terminal. Essa flag permite que os relatórios de progresso sejam feitos ainda que não estejam conectados num terminal. Não é possível usar --progress junto com --porcelain ou --incremental.

-M[<num>]

Detect moved or copied lines within a file. When a commit moves or copies a block of lines (e.g. the original file has A and then B, and the commit changes it to B and then A), the traditional blame algorithm notices only half of the movement and typically blames the lines that were moved up (i.e. B) to the parent and assigns blame to the lines that were moved down (i.e. A) to the child commit. With this option, both groups of lines are blamed on the parent by running extra passes of inspection.

A opção <num> é opcional porém é o limite inferior da quantidade de caracteres alfanuméricos que o Git deve detectar como mover/copiar dentro de um arquivo para associar essas linhas ao commit de origem. 20 é o valor predefinido.

-C[<num>]

In addition to -M, detect lines moved or copied from other files that were modified in the same commit. This is useful when you reorganize your program and move code around across files. When this option is given twice, the command additionally looks for copies from other files in the commit that creates the file. When this option is given three times, the command additionally looks for copies from other files in any commit.

A opção <num> é opcional porém é o limite inferior da quantidade de caracteres alfanuméricos que o Git deve detectar como mover/copiar entre os arquivos para associar estas linhas ao commit de origem. 40 é o valor predefinido. Caso haja mais de uma opção -C, o argumento <num> do último -C entrará em vigor.

--ignore-rev <rev>

Ignore changes made by the revision when assigning blame, as if the change never happened. Lines that were changed or added by an ignored commit will be blamed on the previous commit that changed that line or nearby lines. This option may be specified multiple times to ignore more than one revision. If the blame.markIgnoredLines config option is set, then lines that were changed by an ignored commit and attributed to another commit will be marked with a ? in the blame output. If the blame.markUnblamableLines config option is set, then those lines touched by an ignored commit that we could not attribute to another revision are marked with a *.

--ignore-revs-file <arquivo>

Ignore revisions listed in file, which must be in the same format as an fsck.skipList. This option may be repeated, and these files will be processed after any files specified with the blame.ignoreRevsFile config option. An empty file name, "", will clear the list of revs from previously processed files.

--color-lines

Anotações das cores da linha no formato padrão, diferentemente se elas vierem do mesmo commit da linha anterior. Isso torna mais fácil distinguir os blocos de código introduzidos por diferentes commits. A cor predefinida é ciano e pode ser ajustada usando a opção color.blame.repeatedLines.

--color-by-age

Color line annotations depending on the age of the line in the default format. The color.blame.highlightRecent config option controls what color is used for each range of age.

-h

Exiba a mensagem de ajuda.

VEJA TAMBÉM

GIT

Parte do conjunto git[1]

scroll-to-top