\b character escapes in CLI usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I'm not sure if this is a bug, but it definitely feels like a bug.

A colleague of mine was going through the documentation for the git configuration file format and noticed that \b is a permitted escape.

In some places, such as trying to fetch a remote with this in the URL, git will render the character differently.

[remote "backslashb"]
        url = "\b"
        fetch = +refs/heads/*:refs/remotes/backslashb/*

$ git fetch backslashb
fatal: '?' does not appear to be a git repository
fatal: Could not read from remote repository.

When using "git config --list" however, this is emitted in its raw format, and can be used to mask or hide an actual (probably invalid) value:

$ cat .git/config
[core]
        somevalue = "true\b\b\b\bfalse"
$ git config --local --list
core.somevalue=false

Should "git config" be smarter here and print something other than a literal backspace to the terminal, like "git fetch" does?

[System Info]
git version:
git version 2.34.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64
compiler info: gnuc: 11.4
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash

Kind regards,
Yaakov Smith
Principal Software Engineer
Pronouns: he/him 
e   yaakov.smith@xxxxxxxxxxxxxxxxxx
t    +61 (2) 8001 2200
d   +61 (2) 8986 2753
wisetechglobal.com 

Enabling and empowering the world's supply chains. 
This email is subject to our Confidentiality Statement 






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux