Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaushalmodi/p4ztag_to_json
Convert Perforce P4 Ztag data format to JSON
https://github.com/kaushalmodi/p4ztag_to_json
json nim p4 perforce serialization-format ztag
Last synced: 23 days ago
JSON representation
Convert Perforce P4 Ztag data format to JSON
- Host: GitHub
- URL: https://github.com/kaushalmodi/p4ztag_to_json
- Owner: kaushalmodi
- Created: 2019-05-25T03:15:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-02T17:36:59.000Z (over 3 years ago)
- Last Synced: 2025-01-15T23:40:42.686Z (23 days ago)
- Topics: json, nim, p4, perforce, serialization-format, ztag
- Language: Nim
- Homepage: https://kaushalmodi.github.io/p4ztag_to_json/
- Size: 119 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+title: P4 Ztag to JSON
[[https://github.com/kaushalmodi/p4ztag_to_json/actions/workflows/test.yml][https://github.com/kaushalmodi/p4ztag_to_json/actions/workflows/test.yml/badge.svg]]
[[https://github.com/kaushalmodi/p4ztag_to_json/actions/workflows/docs.yml][https://github.com/kaushalmodi/p4ztag_to_json/actions/workflows/docs.yml/badge.svg]]Little utility to convert the Perforce P4 "Ztag" format data to JSON.
* Command line
** Pass a ztag format text file
#+begin_example
p4ztag_to_json ..
# Generates ..
#+end_example
** Pipe output of a ~p4 -ztag ..~ command to ~p4ztag_to_json~
#+begin_example
p4 -ztag info | p4ztag_to_json
# Prints JSONified version of that input to stdout
#+end_example
* Sample "ztag" data
#+begin_example
... depotFile //ydf/yepba/ik/LEMHT/uopd/tr/ofvd/ai_rgl.ng
... rev0 35
... change0 587347
... action0 mdlo
... type0 rkwr
... time0 1778604642
... user0 vtsoq
... client0 nq:awjyr:xrjmh.cyo:3724802i
... fileSize0 73567
... digest0 R008427167X2MKRE116S1Q0WFA4OP01T
... desc0 fnny txoeb: qltuvf KNN HHJ3 gbdr ydwwcj axmdlinwff- bqq_ljqujqav_ofnw -> CCW_bv
- nea_hswpfmas_vawxny -> WJA_ny
- fse_hnpoqedk_jxf -> VVM_xc... how0,0 poxhsp oilq
... file0,0 //lwj/hfssq/tcjvrcxx/POFJK/lkucc6/ol/gudu/my/kakg/pn_doa.xq
... srev0,0 #ddpk
... erev0,0 #1
... rev1 52
... change1 111522
... action1 myqr
... type1 tkrt
... time1 1332615524
... user1 wpeun
... client1 hu:wedwm:psspa.udl:7045580a
... fileSize1 02622
... digest1 6TVK8T0SV0V8PY454H374KM17AA1K43T
... desc1 Rcrrtxhjv xgr fw_sutxg_nuifp ss ic bxm [QJM]Llkr ta c fmdikgakkl xxohgh .. fusds xfd td_jurfh_ocxji vc bny fiw ftnlfvdw, lhddefunqh wobbo eluoultw fla fnqb jb peotcc.
#+end_example
* Converted JSON
#+begin_src json
[
{
"depotFile": "//ydf/yepba/ik/LEMHT/uopd/tr/ofvd/ai_rgl.ng",
"nested": [
"nested0",
"nested1"
],
"nested0": {
"rev": "35",
"change": "587347",
"action": "mdlo",
"type": "rkwr",
"time": "1778604642",
"user": "vtsoq",
"client": "nq:awjyr:xrjmh.cyo:3724802i",
"fileSize": "73567",
"digest": "R008427167X2MKRE116S1Q0WFA4OP01T",
"desc": "fnny txoeb: qltuvf KNN HHJ3 gbdr ydwwcj axmdlinwff\n- bqq_ljqujqav_ofnw -> CCW_bv\n- nea_hswpfmas_vawxny -> WJA_ny\n- fse_hnpoqedk_jxf -> VVM_xc\n",
"nested": [
"nested0"
],
"nested0": {
"how": " poxhsp oilq",
"file": " //lwj/hfssq/tcjvrcxx/POFJK/lkucc6/ol/gudu/my/kakg/pn_doa.xq",
"srev": " #ddpk",
"erev": " #1"
}
},
"nested1": {
"rev": "52",
"change": "111522",
"action": "myqr",
"type": "tkrt",
"time": "1332615524",
"user": "wpeun",
"client": "hu:wedwm:psspa.udl:7045580a",
"fileSize": "02622",
"digest": "6TVK8T0SV0V8PY454H374KM17AA1K43T",
"desc": "Rcrrtxhjv xgr fw_sutxg_nuifp ss ic bxm [QJM]\nLlkr ta c fmdikgakkl xxohgh .. fusds xfd td_jurfh_ocxji vc bny fiw ftnlfvdw, lhddefunqh wobbo eluoultw fla fnqb jb peotcc."
}
}
]
#+end_src
* References
- [[https://www.perforce.com/manuals/cmdref/Content/CmdRef/Commands%20by%20Functional%20Area.html][Helix Core P4 Command Reference]]
- [[https://www.perforce.com/blog/fun-formatting][Fun with Formatting -- Perforce Blog]]