In the distant future, Islanders may wonder why the town line between Aquinnah and Chilmark suddenly turns east, then north, then east again all within about 80 feet on Boathouse Road. The reason is that the previous straight line, partly as a result of manmade changes since the 1800s, and perhaps some miscalculations, ran through three fishing shacks along the harbor, causing confusion for years.

This month Gov. Charlie Baker signed off on a rare piece of state legislation that finally promises to end the confusion — almost three years after town voters approved a new town line, and 147 years after another act of state legislature created the town of Gay Head, including a small portion of land across the channel in what is now Menemsha.

Chapter 452, An act changing the boundary line between the towns of Aquinnah and Chilmark, finally arrived in the towns last week. In a few paragraphs, it delineates the new boundary, using geographic coordinates and some familiar landmarks for reference. Each of the five buildings on Boathouse Road (famous in part for their appearance in the film Jaws) now lies squarely in one town or another: three in Chilmark and two in Aquinnah.

“It straightens out assessing and permits and whose police department deals with trespassing in what place and all of that,” Chilmark executive secretary Tim Carroll, who was largely responsible for setting the new line, said this week.

Map shows new town line, which required a rare act of the state legislature to become final. — Courtesy Vineyard Land Surveying

It was a quiet ending to a story that goes back to the 1850s, when the state agreed to designate Menemsha Creek as the official boundary between Chilmark and Gay Head. A granite post near the former post office on the harbor was installed around that time, marked with C on one side and GH on the other, although the creek itself was a moving target.

In the early 1900s, the state dredged a new channel between Menemsha Pond and the ocean, creating Menemsha Harbor, along with a new spit of land that the state claimed as its own while allowing public access. The village was rebuilt after the Hurricane of 1938, and in the 1960s, a new channel was dredged, again building up the spit of land, which the state Department of Public Works gave to the towns for commercial fishing. It appears the town line was forgotten or simply overlooked as the village continued to change.

The towns have long relied on a gentleman’s agreement to assess each property along Boathouse Road as being in one town or the other. But the agreement became more complicated around 2013, when a dispute arose involving the ownership of one of the shacks. Around the same time, Aquinnah town assessor Angela Cywinski had confirmed the location of the town line and stopped conducting assessments of the shack, which just barely crossed into Aquinnah. She also began sending bills to the owner of another shack, Jonathan Mayhew, who was a Chilmark selectman at the time.

The towns began taking steps to amend their boundary, which Ms. Cywinski said she had located using a historic brass marker on a house overlooking the harbor, along with the original act of legislature establishing Gay Head as a town, and other documents.

Aquinnah town administrator Adam Wilson said the new legislation was unique for the Island, and perhaps the state. He noted that neither town ended up with any more or less real estate than before, although an earlier proposal would have made Aquinnah about 300 square feet smaller.

Not everyone in Aquinnah was on board with the proposal, as evident in the narrow 21-19 vote at the annual town meeting in 2014. “It wasn’t a mandate for change,” Mr. Wilson said this week. “People were very undecided.”

Ms. Cywinski was among those who would have preferred to keep the original boundary in place, although she does not vote at town meetings. “These markers — the stone monuments and granite markers — are part of the history of our town,” she said. “I believe in keeping things in a historic fashion.”

It may not be a perfect ending, although it’s likely that bookkeeping in both towns will now become a little clearer.

Reid Silva of Vineyard Land Surveying, which drew the new line, said the next step is to install physical markers at each corner. He said the original markers, including the granite post, were likely still on their portion of the line and could remain in place. He was unaware of when the new markers might be installed.