Re: [PATCH v3 6/6] worktree add: switch to worktree version 1

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

 



On Tue, Jan 26, 2016 at 06:44:45PM +0700, Nguyễn Thái Ngọc Duy wrote:
> +		for (key_p = per_wortree_keys; *key_p; key_p++) {
> +			const char *key = *key_p;
> +			char *value = get_key(sb.buf, key);
> +
> +			if (value) {
> +				if (git_config_set(key, value))
> +					die(_("failed to keep %s in main worktree's config file"), key);
> +				if (git_config_set_in_file(sb.buf, key, NULL))
> +					die(_("failed to delete %s in shared config file"), key);
> +				free(value);
> +			}
> +		}

1. For submodules (which must be left per-worktree) this
approach is not going to work, because you don't know all
variables in advance. You could scan the config file and
match those actual keys which are there with patterns.

2. This migrates variables to the default (or current?)
worktree, what about others existing?

-- 
Max
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]