SShortSingh.
Back to feed

Developer builds tool to make git diff understand JSON and YAML structure

0
·1 views

A developer created a custom tool to give git diff semantic awareness of structured data formats like JSON and YAML, after a Kubernetes manifest formatter reordered keys and produced noisy, misleading diffs. Git offers two extension points for this: an external diff driver that fully replaces the diff output, and a textconv filter that normalises file content before comparison. A key discovery was that these two hooks behave differently across git commands — the external driver only activates for git diff, while history commands like git log -p and git show fall back to textconv. Several edge cases required careful handling, including invalid mid-edit files that could abort an entire diff run, temp files without reliable extensions, and encoding issues that could silently erase content. The author recommends starting with a simple shell shim for existing tools, but notes a dedicated subcommand offers better error messaging, cross-platform support, and more reliable file-type detection.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why Distributed Systems Are Hard: Space, Time, and Consensus Explained

Distributed systems arise when multiple machines must cooperate to complete a single task, and that requirement strips away the shared memory, unified clock, and single lock that a solo machine provides for free. The core difficulties trace back to three root problems: space, meaning no single node holds the complete picture; time, meaning there is no global clock and networks reorder messages unpredictably; and consensus, which emerges when the first two problems collide. Replication strategies such as single-leader, multi-leader, and leaderless designs each resolve the write-conflict problem differently but introduce their own failure modes, while partitioning by key range or hash creates further trade-offs between write balance and query efficiency. Because there is no reliable wall clock across machines, engineers use logical and vector clocks to track causality rather than absolute time, though vector clocks grow costly at scale. These compounding challenges explain why distributed systems offer a spectrum of consistency models — from strict linearizability to eventual consistency — each trading correctness guarantees for performance or availability.

0
ProgrammingHacker News ·

Chamilo 3.0 Released: Open-Source LMS Gains Native MCP Server Support

Chamilo, an open-source learning management system, has released version 3.0.0, marking a significant update to the platform. The new release introduces a native MCP server with support for PAuth 2.1, a modern authentication protocol. The update was announced via the project's official GitHub repository. Chamilo LMS is widely used by educational institutions and organizations to deliver and manage online learning content.

0
ProgrammingDEV Community ·

How a 4TB-to-500GB table join triggered a $4,000/hour cloud bill and outage

A data engineering team incurred roughly $4,000 in a single hour after a production join between a 4TB events table and a 500GB user_metadata table caused out-of-memory failures on both BigQuery and Databricks. The query had completed in 42 seconds on a 10% staging sample but hung for 45 minutes in production, spiking BigQuery slot usage above 10,000 and crashing a Databricks SQL Warehouse with a Java heap error. The root cause was each engine attempting a broadcast join on a table far too large to fit in a single worker's memory, compounded by a Databricks configuration that had raised the auto-broadcast threshold to 1GB from its 10MB default. The team resolved the BigQuery issue by rewriting the query to select specific columns and pre-filter join keys, cutting shuffle volume from 12TB to 800GB. On Databricks, they overrode the optimizer with a MERGE hint to force a Shuffle Sort-Merge Join, which spilled to disk rather than crashing, completing the query in 12 minutes.

0
ProgrammingDEV Community ·

Hyperiux Vault CLI Lets Developers Add Cursor Effects to Next.js Projects

Hyperiux Vault is a source-first tool that installs creative UI effects, such as cursor interactions, scroll animations, and page transitions, directly into React and Next.js projects via a CLI. Rather than importing from a runtime package, the CLI copies effect source files into the developer's own codebase, giving full control over customization and implementation. The tool supports Next.js 14 and 15, React 18+, Tailwind CSS v3 and v4, and works with both App Router and Pages Router setups. A tutorial walkthrough demonstrates installing the GSAP-powered Phantom Image Trail cursor effect, covering initialization, file inspection, rendering, and accessibility adjustments. Because the source lives in the project repository, developers take on responsibility for ongoing maintenance, upgrades, and performance of the installed effects.

Developer builds tool to make git diff understand JSON and YAML structure · ShortSingh