Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: fall back to $USER if username couldn't be obtained by libc
If jj is compiled against musl libc, not all name services are available, and getpwuid() can return null even if the system is configured properly. That's the problem reported as jj-vcs#5231. Suppose operation.username exists mainly for logging/tracing purposes, it should be better to include something less reliable than leaving the field empty. This patch also removes TODO comment about empty hostname/username. It's unlikely that the hostname is invalid (as that would cause panic on older jj versions), and $USER would probably be set on Unix.
- Loading branch information