git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] filter-branch.sh: support nearly proper tag name filtering

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Mar 24, 2008, 19:02 UTC
Message-ID
<47E7FACD.7020409@nrlssc.navy.mil>
In-Reply-To
<7vr6e01xja.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 17 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
>> On Thu, 20 Mar 2008, Brandon Casey wrote:
>>
>>> Add support for creating a new tag object and retaining the tag message, 
>>> author, and date when rewriting tags. The gpg signature, if one exists, 
>>> will be stripped.
>>>
>>> This adds nearly proper tag name filtering to filter-branch. Proper tag 
>>> name filtering would include the ability to change the tagger, tag date, 
>>> tag message, and _not_ strip a gpg signature if the tag did not change.
>> I think such a change in semantics merits a new option.
> 
> It is a different story if the fix is a good one, or has room for
> improvement.  For example, the sed script that knows what is on the first
> and second line and relies on that knowledge to use 1c...2c... looked very
> fragile to me.
This tag format is described in the documentation for git-mktag as follows:
   Tag Format
   ----------
   A tag signature file has a very simple fixed format: four lines of
     object <sha1>
     type <typename>
     tag <tagname>
     tagger <tagger>
   followed by some 'optional' free-form message (some tags created
   [...]

So, as long as git-cat-file succeeds, shouldn't we get this format piped to sed? The type is hard coded to "commit", since $new_ref will always be a commit (the old tag could have referenced another tag), otherwise the earlier rev-parse would have failed.

The portion that strips the signature, does rely on the fact that git-tag always adds the signature to the end of the tag object. Rather than stripping only between the pgp BEGIN and END markers. And the 'Q' directive may not be portable, but I really don't know.

Suggestions?
-brandon
Previous: Eyvind BernhardsenNext: Brandon Casey
Message 17 of 23 in “filter-branch.sh: support nearly proper tag name filtering”
  1. 2/2 filter-branch.sh: support nearly proper tag name filteringBrandon Casey, Mar 20, 2008
  2. Johannes SchindelinMar 20, 2008
  3. Brandon CaseyMar 20, 2008
  4. Junio C HamanoMar 24, 2008
  5. Johannes SchindelinMar 24, 2008
  6. Junio C HamanoMar 24, 2008
  7. Johannes SchindelinMar 24, 2008
  8. Brandon CaseyMar 24, 2008
  9. Brandon CaseyMar 24, 2008
  10. Johannes SchindelinMar 24, 2008
  11. Brandon CaseyMar 24, 2008
  12. Johannes SchindelinMar 24, 2008
  13. Brandon CaseyMar 24, 2008
  14. filter-branch --all?Eyvind Bernhardsen, Mar 24, 2008
  15. Brandon CaseyMar 24, 2008
  16. Eyvind BernhardsenMar 24, 2008
  17. Brandon CaseyMar 24, 2008
  18. filter-branch.sh: support nearly proper tag name filteringBrandon Casey, Mar 24, 2008
  19. Brandon CaseyMar 24, 2008
  20. Junio C HamanoMar 25, 2008
  21. filter-branch.sh: support nearly proper tag name filteringBrandon Casey, Mar 25, 2008
  22. Junio C HamanoMar 26, 2008
  23. filter-branch.sh: support nearly proper tag name filteringBrandon Casey, Mar 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.