git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Make "git-ls-files" work in subdirectories

From
CWChris Wedgwood <cw@f00f.org>
Date
Aug 21, 2005, 22:46 UTC
Message-ID
<20050821224622.GB26241@taniwha.stupidest.org>
In-Reply-To
<Pine.LNX.4.58.0508211210500.3317@g5.osdl.org>
On Sun, Aug 21, 2005 at 12:55:33PM -0700, Linus Torvalds wrote:
Show 88 quoted lines
> -		} else if (!strcmp(arg, "-t")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-t")) {
>  			tag_cached = "H ";
>  			tag_unmerged = "M ";
>  			tag_removed = "R ";
>  			tag_other = "? ";
>  			tag_killed = "K ";
> -		} else if (!strcmp(arg, "-c") || !strcmp(arg, "--cached")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-c") || !strcmp(arg, "--cached")) {
>  			show_cached = 1;
> -		} else if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) {
>  			show_deleted = 1;
> -		} else if (!strcmp(arg, "-o") || !strcmp(arg, "--others")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-o") || !strcmp(arg, "--others")) {
>  			show_others = 1;
> -		} else if (!strcmp(arg, "-i") || !strcmp(arg, "--ignored")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-i") || !strcmp(arg, "--ignored")) {
>  			show_ignored = 1;
> -		} else if (!strcmp(arg, "-s") || !strcmp(arg, "--stage")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-s") || !strcmp(arg, "--stage")) {
>  			show_stage = 1;
> -		} else if (!strcmp(arg, "-k") || !strcmp(arg, "--killed")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-k") || !strcmp(arg, "--killed")) {
>  			show_killed = 1;
> -		} else if (!strcmp(arg, "-u") || !strcmp(arg, "--unmerged")) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-u") || !strcmp(arg, "--unmerged")) {
>  			/* There's no point in showing unmerged unless
>  			 * you also show the stage information.
>  			 */
>  			show_stage = 1;
>  			show_unmerged = 1;
> -		} else if (!strcmp(arg, "-x") && i+1 < argc) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-x") && i+1 < argc) {
>  			exc_given = 1;
>  			add_exclude(argv[++i], "", 0, &exclude_list[EXC_CMDL]);
> -		} else if (!strncmp(arg, "--exclude=", 10)) {
> +			continue;
> +		}
> +		if (!strncmp(arg, "--exclude=", 10)) {
>  			exc_given = 1;
>  			add_exclude(arg+10, "", 0, &exclude_list[EXC_CMDL]);
> -		} else if (!strcmp(arg, "-X") && i+1 < argc) {
> +			continue;
> +		}
> +		if (!strcmp(arg, "-X") && i+1 < argc) {
>  			exc_given = 1;
>  			add_excludes_from_file(argv[++i]);
> -		} else if (!strncmp(arg, "--exclude-from=", 15)) {
> +			continue;
> +		}
> +		if (!strncmp(arg, "--exclude-from=", 15)) {
>  			exc_given = 1;
>  			add_excludes_from_file(arg+15);
> -		} else if (!strncmp(arg, "--exclude-per-directory=", 24)) {
> +			continue;
> +		}
> +		if (!strncmp(arg, "--exclude-per-directory=", 24)) {
>  			exc_given = 1;
>  			exclude_per_dir = arg + 24;
> -		} else
> +			continue;
> +		}
> +		if (!strcmp(arg, "--full-name")) {
> +			prefix_offset = 0;
> +			continue;
> +		}
> +		if (glob || *arg == '-')
>  			usage(ls_files_usage);
> +		glob = arg;
is there some aversion to getopt or similar get?
Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 5 in “Make "git-ls-files" work in subdirectories”
  1. Linus TorvaldsAug 21, 2005
  2. Chris WedgwoodAug 21, 2005
  3. Linus TorvaldsAug 21, 2005
  4. Chris WedgwoodAug 21, 2005
  5. YOSHIFUJI Hideaki / 吉藤英明Aug 21, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.