{"id":29086375,"url":"https://github.com/sukibaby/reversefirtree","last_synced_at":"2026-04-22T23:34:54.530Z","repository":{"id":300036800,"uuid":"1004999391","full_name":"sukibaby/ReverseFirTree","owner":"sukibaby","description":"Sorts a list of variables into reverse fir tree (reverse XMAS tree / reverse Christmas tree) formatting. Written in PowerShell.","archived":false,"fork":false,"pushed_at":"2025-06-19T14:53:55.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-19T15:26:16.641Z","etag":null,"topics":["c-plus-plus","formatter","formatting","helper-script","helper-tool","kernel-development","powershell-script","reverse-christmas-tree","reverse-fir-tree","reverse-xmas-tree","reversefirtree","reversexmastree","xmas-tree"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sukibaby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-19T13:59:45.000Z","updated_at":"2025-06-19T14:53:58.000Z","dependencies_parsed_at":"2025-06-19T15:37:20.597Z","dependency_job_id":null,"html_url":"https://github.com/sukibaby/ReverseFirTree","commit_stats":null,"previous_names":["sukibaby/reversefirtree"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sukibaby/ReverseFirTree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukibaby%2FReverseFirTree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukibaby%2FReverseFirTree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukibaby%2FReverseFirTree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukibaby%2FReverseFirTree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sukibaby","download_url":"https://codeload.github.com/sukibaby/ReverseFirTree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukibaby%2FReverseFirTree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262352625,"owners_count":23297689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","formatter","formatting","helper-script","helper-tool","kernel-development","powershell-script","reverse-christmas-tree","reverse-fir-tree","reverse-xmas-tree","reversefirtree","reversexmastree","xmas-tree"],"created_at":"2025-06-28T00:06:37.604Z","updated_at":"2026-04-22T23:34:49.500Z","avatar_url":"https://github.com/sukibaby.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PSScriptAnalyzer](https://github.com/sukibaby/ReverseFirTree/actions/workflows/powershell.yml/badge.svg?branch=master\u0026event=push)](https://github.com/sukibaby/ReverseFirTree/actions/workflows/powershell.yml)\n\nI didn't find any tool to easily format a list of variables as reverse fir tree (a.k.a. reverse christmas tree, reverse XMAS tree), so I threw together a little PowerShell script. :-)\n\nRunning this script on a text file named `input.txt` with the following contents:\n```\nint \tsamplebits = 16;\nunsigned int\tlast_cursor_pos = 0;\nint\tpreferred_writeahead = 8192;\nWAVEHDR\tpcm = nullptr;\nbool bInit = false;\narray1 = {};\nint32_t\t    sample_rate_thing_  =   44100;\nfloat   myCooolFloat  = 16;\narray2 ={} ;\n```\n\nwill provide a nicely formatted output file `input_formatted.txt` with the following contents:\n```\nint32_t sample_rate_thing_ = 44100;\nunsigned int last_cursor_pos = 0;\nint preferred_writeahead = 8192;\nfloat myCooolFloat = 16;\nWAVEHDR pcm = nullptr;\nint samplebits = 16;\nbool bInit = false;\narray1 = {};\narray2 = {};\n```\n\nIt is capable of tie-breaking for commonly known C++ datatypes, and falls back on alphabetical sorting.\n\nIt uses PowerShell features which were introdued in PowerShell 3.0, so it should run as-is on the PowerShell that ships with Windows 8 and higher. Windows 7 users may need to upgrade first though.\n\nReverse fir tree styling is not very well documented, but is recommended in Kernel Maintainers [KVM 5.4.2 \"Coding Style\"](https://docs.kernel.org/process/maintainer-kvm-x86.html).\n\nI would welcome any suggestions on ways the sorting mechanism could be further refined.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukibaby%2Freversefirtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukibaby%2Freversefirtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukibaby%2Freversefirtree/lists"}