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

Re: Can git tell me which uncommitted files clash with the incoming changes?

From
Jeff King <peff@peff.net>
Date
Dec 18, 2018, 13:14 UTC
Message-ID
<20181218131429.GE30471@sigill.intra.peff.net>
In-Reply-To
<CAG2YSPy85YtAv6m5WR4ZrsZ4TRzgcyrC4DNZnOONtFD6MsH=YQ@mail.gmail.com>
On Mon, Dec 17, 2018 at 05:50:31PM -0500, Mark Kharitonov wrote:
Show 17 quoted lines
> Guys, having git merge --dry-run would be great, but I am OK with git
> merge for real as long as its output is parseable.
> 
> However, somewhere in between git 2.18 and git 2.20 the output of
> merge changed and now I do not know how to parse it.
> it used to be something like that:
> 
> bla bla bla
> <tab>file name 1
> <tab>file name 2
> ...
> bla bla bla
> 
> But now, the files are output in one line and given that some files
> may have spaces in the name I do not see how this can be parsed. If we
> could have easily parseable output of merge, it would be enough for
> me.
Interesting. I don't see that behavior at all. E.g., running this:

-- >8 -- git init repo cd repo

echo base >base; git add base; git commit -m base
for i in one two three; do
	echo $i >$i
done
git add .
git commit -m master

git checkout -b other HEAD^ echo other >other; git add other; git commit -m other

for i in one two three; do
	echo working-tree >$i
done

git pull . master -- 8< --

I see:
  error: The following untracked working tree files would be overwritten by merge:
  	one
  	three
  	two
  Please move or remove them before you merge.
I wonder if it has to do with Windows.

If you can reproduce it at will, can you try bisecting between v2.18 and v2.20 to see which commit introduced the change?

-Peff
Previous: Mark KharitonovNext: Elijah Newren
Message 9 of 10 in “Can git tell me which uncommitted files clash with the incoming changes?”
  1. Mark KharitonovDec 17, 2018
  2. Jeff KingDec 17, 2018
  3. Ævar Arnfjörð BjarmasonDec 17, 2018
  4. Jeff KingDec 17, 2018
  5. Duy NguyenDec 17, 2018
  6. Elijah NewrenDec 17, 2018
  7. Duy NguyenDec 17, 2018
  8. Mark KharitonovDec 17, 2018
  9. Jeff KingDec 18, 2018
  10. Elijah NewrenDec 18, 2018

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.