2011-11-11 12 views
9

Occasionalmente abbiamo due tag sullo stesso commit. Quando usiamo git descriviamo quel commit, git descrive sempre restituisce il primo tag. La mia lettura della pagina man di git-describe sembra indicare che il secondo tag deve essere restituito (che ha più senso).git descrivere con due tag sullo stesso commit

SEARCH STRATEGY 
    For each committish supplied, git describe will first look for a tag which tags 
    exactly that commit. Annotated tags will always be preferred over lightweight tags, 
    and tags with newer dates will always be preferred over tags with older dates. 
    If an exact match is found, its name will be output and searching will stop. 

C'è un modo per avere git describe restituire il secondo tag?

risposta

3

Hai provato nessuna delle opzioni per descrivere Git?

--all 
     Instead of using only the annotated tags, use any ref found in .git/refs/. This option enables 
     matching any known branch, remote-tracking branch, or lightweight tag. 

    --tags 
     Instead of using only the annotated tags, use any tag found in .git/refs/tags. This option 
     enables matching a lightweight (non-annotated) tag. 
+3

Sfortunatamente, utilizziamo già queste opzioni. Mi chiedo se questo è un bug? –

+0

L'ho appena provato - Funziona finché il tag è annotato - se aggiungo un tag leggero viene ignorato. –

+0

Un test: tag 'git $ -a test-1 -m "Solo un test" $ git descrivere test-1 tag git $ -a test-2 -m "Un altro test" $ git descrivere prova -1 $ git --version git versione 1.7.1' –

Problemi correlati