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

Re: [RFC PATCH 2/2] git-p4: support loading changelist descriptions

From
MAMazo, Andrey <amazo@checkvideo.com>
Date
Mar 25, 2019, 17:46 UTC
Message-ID
<20190325174615.1231-1-amazo@checkvideo.com>
In-Reply-To
<CAE5ih793TVn0NJ54CJTmOZ0Gr2Y4GSYwP-DAyRpjsgJsGc-NrA@mail.gmail.com>
23.03.2019, 04:44, "Luke Diamand" <luke@diamand.org>:
Show 10 quoted lines
> On Fri, 22 Mar 2019 at 19:54, Mazo, Andrey <amazo@checkvideo.com> wrote:
>>  Our Perforce server experienced some kind of database corruption a few years ago.
>>  While the file data and revision history are mostly intact,
>>  some metadata for several changesets got lost.
>
> I think it's not unheard of for P4 databases to end up being corrupt,
> as in your case.
>
> It looks like the RCS files get updated, but the database files (i.e.
> the metadata) do not, after which you have a bit of a problem.
Yeah, that's exactly what happened! :/
> So I guess this change could be quite useful, but it really needs some
> documentation and tests to support it - git-p4 is already complicated
> enough!

Great, thanks for positive feedback. Let me start working on these. Luckily, the actual git-p4 changes are fairly straightforward.

> Your example script should probably use the same magic that the git-p4
> script uses to pick the path to Python.

Oh, you mean "#!/usr/bin/env python"? Sure!

Actually, I also have a smarter "example script", which reconstructs `p4 describe` output from `p4 files` and `p4 change` without manual intervention. It's still short enough to be posted inside commit message, but would it make sense to put it under contrib/ and reference from the docs?

> And perhaps come up with a nicer name than "damaged" - as you say, it
> could also be used for other purposes.
Does anything from the list below sound reasonable?
 1. git-p4.loadChangelistInfo
 2. git-p4.changelistInfoOverride
 3. git-p4.cachedChangelistInfo
>> For simplicity, it's one pickled file per changelist.

(talking to myself) I realized `p4 -G describe` produces a marshalled output, not pickled one. Don't know why I decided to use pickle instead of marshal back when I wrote it. I'll switch to marshal for serialization/deserialization in the next reroll. It'll be easier for testing as well, since `p4 -G describe` output could be fed directly to damagedChangelists machinery without the need to convert it from marshal to pickle.

Thank you, Andrey

Previous: Luke DiamandNext: Mazo, Andrey
Message 24 of 40 in “git-p4: a few assorted fixes for branches, excludes”
  1. 0/5 git-p4: a few assorted fixes for branches, excludesMazo, Andrey, Mar 4, 2019
  2. 1/5 git-p4: detect/prevent infinite loop in gitCommitByP4Change()Mazo, Andrey, Mar 4, 2019
  3. 2/5 git-p4: match branches case insensitively if configuredMazo, Andrey, Mar 4, 2019
  4. 3/5 git-p4: don't groom exclude path list on every commitMazo, Andrey, Mar 4, 2019
  5. 4/5 git-p4: add failing test for "don't exclude other files with same prefix"Mazo, Andrey, Mar 4, 2019
  6. 5/5 git-p4: don't exclude other files with same prefixMazo, Andrey, Mar 4, 2019
  7. 0/7 git-p4: a few assorted fixes for branches, excludesMazo, Andrey, Mar 21, 2019
  8. 2/7 git-p4: match branches case insensitively if configuredMazo, Andrey, Mar 21, 2019
  9. Luke DiamandMar 23, 2019
  10. Mazo, AndreyMar 25, 2019
  11. 1/7 git-p4: detect/prevent infinite loop in gitCommitByP4Change()Mazo, Andrey, Mar 21, 2019
  12. 3/7 git-p4: don't groom exclude path list on every commitMazo, Andrey, Mar 21, 2019
  13. 4/7 git-p4: add failing test for "don't exclude other files with same prefix"Mazo, Andrey, Mar 21, 2019
  14. 5/7 git-p4: don't exclude other files with same prefixMazo, Andrey, Mar 21, 2019
  15. 6/7 git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"Mazo, Andrey, Mar 21, 2019
  16. 7/7 git-p4: respect excluded paths when detecting branchesMazo, Andrey, Mar 21, 2019
  17. 0/2 git-p4: "alien" branches and load changelist info from fileMazo, Andrey, Mar 22, 2019
  18. 1/2 git-p4: introduce alien branch mappingsMazo, Andrey, Mar 22, 2019
  19. Luke DiamandMar 23, 2019
  20. Mazo, AndreyMar 26, 2019
  21. 1/1 git-p4: inexact label detectionMazo, Andrey, Mar 27, 2019
  22. 2/2 git-p4: support loading changelist descriptions from filesMazo, Andrey, Mar 22, 2019
  23. Luke DiamandMar 23, 2019
  24. Mazo, AndreyMar 25, 2019
  25. 0/8 git-p4: a few assorted fixes for branches, excludesMazo, Andrey, Apr 1, 2019
  26. 1/8 git-p4: detect/prevent infinite loop in gitCommitByP4Change()Mazo, Andrey, Apr 1, 2019
  27. 2/8 git-p4: add failing test for "git-p4: match branches case insensitively if configured"Mazo, Andrey, Apr 1, 2019
  28. SZEDER GáborApr 2, 2019
  29. Mazo, AndreyApr 2, 2019
  30. Junio C HamanoApr 3, 2019
  31. 4/8 git-p4: don't groom exclude path list on every commitMazo, Andrey, Apr 1, 2019
  32. 3/8 git-p4: match branches case insensitively if configuredMazo, Andrey, Apr 1, 2019
  33. 5/8 git-p4: add failing test for "don't exclude other files with same prefix"Mazo, Andrey, Apr 1, 2019
  34. 6/8 git-p4: don't exclude other files with same prefixMazo, Andrey, Apr 1, 2019
  35. 7/8 git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"Mazo, Andrey, Apr 1, 2019
  36. 8/8 git-p4: respect excluded paths when detecting branchesMazo, Andrey, Apr 1, 2019
  37. Mazo, AndreyApr 1, 2019
  38. 0/2 git-p4: inexact labels and load changelist description from fileMazo, Andrey, Apr 2, 2019
  39. 1/2 git-p4: inexact label detectionMazo, Andrey, Apr 2, 2019
  40. 2/2 git-p4: support loading changelist descriptions from filesMazo, Andrey, Apr 2, 2019

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.